
modp, mods - modulo functions

Calling sequence:

modp(rational, integer)
mods(rational, integer)

Parameter:
rational   --  rational number
integer    --  integer

Overloading:

all

Summary:

modp and mods calculate the positive or respectively the symmetrical modulo
functions.  The second argument represents the modulus and must be an
integer. If the first argument is a rational number then the modular inverse
of the denominator is calculated and then multiplied with the numerator.

The functions modp and mods can be used to re-define the modulo operator
mod. After the assignment _mod := mods; the mod operator  calculates the
symmetrical modulo function.  After the assignment _mod := modp; the
operator again calculates the positive modulo function (as at the beginning
of the MuPAD session).

The functions return an error when the arguments are numbers of a wrong
type. If an argument cannot be evaluated to a number then the function call
with evaluated arguments is returned. modp and mods are kernel functions.

>>  modp(4/3, 7);

      6

>>  mods(4/3, 7);

      -1

>>  11 mod 7; _mod := mods: 11 mod 7;

      4, -3

