wrap
Return the remainder of integer division.
Synopsis
val = wrap(value, range)
Description
wrap returns the modulus of value, using range as the modulo;
i.e., it will keep value within range by “wrapping” it around.
See also mod which apparently does the same thing.
Arguments
- value, range
The parameters used to perform the “wrapping” (i.e., a % b; in
this case, value % range) operation. Essentially wrap gives
the remainder of dividing value into range. Modular (or
“clock”) arithmetic is very useful in western, 12-note/octave music.
Examples
See Also
abs, log, pow, max,
mod, min, round,
trunc, fwrap