Sloppy_Math module

min_of_type

procedure · 1 overloadSource

The smallest value of the numeric type T: the lowest integer, so -128 for s8 and 0 for any unsigned type.

For float32 and float64 this is the smallest positive normal number (Math.FLOAT32_MIN), not the most negative finite value; use -max_of_type(float32) for that. Any other type fails an assert.

ExampleOpen in playground ↗
assert(min_of_type(s8) == -128);
assert(min_of_type(s32) == -2147483648);
assert(min_of_type(u16) == 0);
assert(min_of_type(float32) > 0);
min_of_type :: ($T: Type) -> T

Parameters

$T: Type

Returns

T

See also