Darwin Help

Back to Index

mod

Function mod


Calling Sequence  mod(x,y)
Parameters
NameTypeDescription

x numerica number
y numerica number > 0
Return Type  numeric
Synopsis This function computes the function x (mod y) i.e. it returns the integer remainder after dividing y into x. Note: if x or y are so large that they cannot be represented exactly as integers in a double precision number, the results may be wrong.
Examples
> mod(5,2);
1
> mod(99,1);
0
> mod(-3,2);
1
See also ceil,   floor,   round,   trunc