Skip to main content

Float.%

%that

Group: Operators
Aliases: modulo, modulus

Documentation

Computes the remainder when dividing this by that.

Modulus in Enso will undergo automatic conversions such that you need not convert between Integer and Float manually.

Arguments

  • that: The number to divide this by.

Examples

Computing the remainder when dividing 3.5 by 2.

      3.5 % 2 == 1.5

Computing the fractional part of a number.

      10.5 % 1.0 == 0.5

Computing the remainder of a negative number.

      -5 % 3 == -2

Remarks

Negative Arguments

When the first argument to % is negative, the result will also be negative.