@mod

@mod

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

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

  • @mod(-5, 3) == 1
  • (@divFloor(a, b) * b) + @mod(a, b) == a

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

See also:

  • @rem