Modulo with result in range
[y, nrev] = CL_rMod(x, a, b) [y, nrev] = CL_rMod(x, a)
Computes the modulo in a given range.
The result y is such that y = x modulo [b-a] with y in [a,b[.
That is to say: y = x + nrev * (b-a) with nrev: integer such that y belongs to [a, b[.
Notes:
- x,a,b can be of any size or of size 1x1, but the sizes must be consistent (the function does not check the sizes).
- CL_rMod(x, a) is the same as CL_rMod(x, 0, a)
- CL_rMod([], a, b) = []
Vector or matrix of real values (any size)
Minimum value (1x1 or same size as x)
Maximum value (strictly greater than a) (1x1 or same size as a)
Result of "x modulo (b-a)" belonging to [a,b[ (maximum size between x, a, b)
(integer) Number of times "b-a" has been added to x (same size as y)
CNES - DCT/SB