Usage
divide(a, b)
a mod n
a mod b
a quo b
a rem b
Signatures
divide: (%,%) (%, %)
mod,quo,rem: (%,%) %
mod: (%,MachineInteger) MachineInteger
Parameter | Type | Description |
---|---|---|
a,b | % | integers, ![]() |
n | MachineInteger | a nonzero machine integer |
Returns
mod
(resp.
mod
) returns
such that
(resp.
) and
(resp
), while
rem
returns
such that
and
,
quo
returns
rem
, and divide(a, b) returns the pair (a quo b, a rem b).
Remarks
mod returns a unique remainder modulo b, but is more expensive to compute than rem, and is not guaranteed to be compatible with the result of quo. The version whose second argument is a MachineInteger allows for more efficient implementations.