Description Usage Arguments Details Value Alternative usage Note
The '%%'
operator calculates the modulo, but sometimes has rounding errors, e.g. "(9.1/.1) %% 1
" gives ~ 1, instead of 0.
Comparable to what all.equal does, this operator has some tolerance for small rounding errors.
If the answer would be equal to the divisor within a small tolerance, 0 is returned instead.
1 |
x, y |
numeric vectors, similar to those passed on to %% |
tolerance |
numeric, maximum difference, see |
For integer x and y, the normal %%-operator is used
identical to the result for %%, unless the answer would be really close to y, in which case 0 is returned
x %mod% y
may be most useful in practice
To specify tolerance, use the call `%mod%`(x,y,tolerance)
The precedence for %mod%
is the same as that for %%
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.