modulo

v0.9.6arrow_drop_down
v0.9.6
STATUS
Passing
DOWNLOADS
2
VISIBILITY
Public
PUBLISHED
5 years ago
SIZE
796 B
Divides the first parameter by the second and returns the remainder.
1 contributor
Install modulo as a package?
Copied
npm i @bit/justin-capalbo.ramda.modulo
Set Bit as a scoped registryLearn more
npm config set '@bit:registry' https://node.bit.cloud
Component Example
React
React
Vue
Angular
React Native
Add dependency... help_outline
Just
import
any of the 1 million components
and packages in Bit or NPM to the example.
import Button from '@bit/grommet.grommet.button';
import Lodash from 'lodash';
toggle layout
No preview available
modifieddraft
chevron_left
chevron_right
modulo (
a:Number,
b:Number
) : Number

Divides the first parameter by the second and returns the remainder. Note that this function preserves the JavaScript-style behavior for modulo. For mathematical modulo see mathMod.

Example
R.modulo(17, 3); //=> 2
     // JS behavior:
     R.modulo(-17, 3); //=> -2
     R.modulo(17, -3); //=> 2

     const isOdd = R.modulo(R.__, 2);
     isOdd(42); //=> 0
     isOdd(21); //=> 1
Arguments
a: Number

The value to the divide.

b: Number

The pseudo-modulus

Returns
Number

The result of `b % a`.

Help and resources