Modules

Sloppy_Math

moduleSource
macOSLinuxWindowswasm

#import "Sloppy_Math";

Approximate float comparison and the numeric limits of a type.

Procedures#

($T: Type) -> T

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

#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);
↗