Previous Up Next

5.5.9  The integer Euclidean remainder: irem remain smod mods mod %

The irem command finds the remainder of two integers (see Section 5.5.8).
remain is a synonym for irem.

Examples.


The smod command finds the symmetric remainder of two (ordinary) integers.
mods is a synonym for smod.

Example.

Input:

smod(148,5)

Output:

−2


The mod operator is an infixed operator which takes an integer to a modular integer.
% is a synonym for mod.

Example.

Input:

148 mod 5

or:

148 % 5

Output:


−2
%5

Note that the result -2 % 5 is not an integer (-2) but an element of Z/5Z (see Section 5.34 for the possible operations in Z/5Z).


Previous Up Next