Elex.Functions.Mod (Elex v0.2.1)

View Source

Returns the floored modulo of a divided by b (sign follows the divisor).

Unlike rem/2, which keeps the sign of the dividend, mod(-3, 2) returns 1 while rem(-3, 2) returns -1.

Expression syntax

mod(10, 3)