Number Remainder
rascal-0.40.17
Synopsis
Remainder of two integer values.
Syntax
Exp₁ % Exp₂
Types
Exp₁ | Exp₂ | Exp₁ % Exp₂ |
---|---|---|
int | int | int |
Description
Yields the remainder when dividing the of Exp₁ by the value of Exp₂.
Examples
rascal>12 % 5
int: 2
rascal>12 % 6
int: 0
Pitfalls
Remainder is only defined on integers:
rascal>13.5 % 6
|prompt:///|(7,1,<1,7>,<1,8>): remainder not supported on real and int
Advice: |https://www.rascal-mpl.org/docs/Rascal/Errors/CompileTimeErrors/UnsupportedOperation|
ok