math
math
Mathematical helper functions over signed 32-bit integers.
This module is small on purpose — i32 operators cover most of what user code needs day-to-day. The wrappers here exist so users can write math.abs(x) instead of inlining branches everywhere.
Items
fn abs— Returns the absolute value of an integer.fn min— Returns the smaller ofaandb. See also max and clamp.fn max— Returns the larger ofaandb. See also min and clamp.fn clamp— Clampsxinto the inclusive range[lo, hi]. Equivalent to