Sloppy_Math module

max_of_type

procedure · 1 overloadSource

The largest finite value of the numeric type T: 255 for u8, Math.FLOAT32_MAX for float32. Any non-numeric type fails an assert.

ExampleOpen in playground ↗
#import "Math";
assert(max_of_type(u8) == 255);
assert(max_of_type(s64) == 9223372036854775807);
assert(max_of_type(u64) == 0xFFFF_FFFF_FFFF_FFFF);
assert(max_of_type(float32) == FLOAT32_MAX);
max_of_type :: ($T: Type) -> T

Parameters

$T: Type

Returns

T

See also