Function mod( a, b )
- Description:
-
Returns the non-negative remainder of
a/b
.
This is a modulo operation, but differs from the expression
a%b
in that the answer is always >=0
(as long as b
is not zero).
- Parameters:
-
- a (floating point)
- dividend
- b (floating point)
- divisor
- Return Value (floating point):
- non-negative remainder when
dividing
a
by b
- Examples:
modulo(14, 5) = 4
modulo(-14, 5) = 1
modulo(2.75, 0.5) = 0.25
- Signature:
- double mod(double, double)