Function mod

Source
pub fn mod(op1: i32, op2: i32) -> i32
Expand description

Computes the remainder of the first operand divided by the second operand, saturating on overflow. This serves as the definition of the remainder operation in the dice expression language.

§Parameters

  • op1: The dividend.
  • op2: The divisor.

§Returns

The remainder of op1 divided by op2.

§Examples

assert_eq!(r#mod(6, 4), 2);
assert_eq!(r#mod(6, 0), 0);
assert_eq!(r#mod(i32::MIN, -1), 0);