% — remainder

Syntax and values

Behavior and details

The % operator finds the remainder after division. With seven counters arranged in groups of three, two complete groups use six counters and one remains: 7 % 3 is 1.

Pliro also accepts fractional Numbers. Its remainder follows the sign of the first number, the dividend: -7 % 3 is -1. Some other languages use a modulo rule that instead gives a nonnegative answer for a positive divisor; do not assume those rules are identical. A zero divisor produces E4003. This symbol does not format text.

Example

# language: en
say 7 % 3
say(-7 % 3)
say 5.5 % 2

Syntax and values · Built-ins · Programming guides