fn cast(comptime T: type, x: anytype) ?T

Cast an integer to a different integer type. If the value doesn’t fit, return null.

Parameters

T: type,
x: anytype,