1 contributor
Like
Install math-mod as a package?
Copied
npm i @bit/justin-capalbo.ramda.math-mod
Set Bit as a scoped registryLearn more
npm config set '@bit:registry' https://node.bit.cloud
Component Example modifieddraft
React
React
Vue
Angular
React Native
Add dependency... help_outline
Just
and packages in Bit or NPM to the example. any of the 1 million componentstoggle layout
No preview available
chevron_left
chevron_right
mathMod (
m:
Number
,p:
) : Number
Number
mathMod
behaves like the modulo operator should mathematically, unlike the
%
operator (and by extension, R.modulo
). So while
-17 % 5
is -2
, mathMod(-17, 5)
is 3
. mathMod
requires Integer
arguments, and returns NaN when the modulus is zero or negative.
Example
Arguments
m:
Number
The dividend.
p:
Number
the modulus.
Returns
Number
The result of `b mod a`.