@rem

@rem

@rem(numerator: T, denominator: T) T

Remainder division. For unsigned integers this is the same as numerator % denominator. Caller guarantees denominator > 0.

  • @rem(-5, 3) == -2
  • (@divTrunc(a, b) * b) + @rem(a, b) == a

For a function that returns an error code, see @import("std").math.rem.

See also:

  • @mod