1.0.1 • Published 6 years ago
mod-op v1.0.1
mod-op
Introduction:
Modulo operator as a function for JavaScript, as it only has the remainder (%
) operator by default.
mod(dividend, divisor)
Perform dividend
modulo divisor
Arguments
dividend
- Numberdivisor
- Number
Example
var mod = require('mod-op');
var wrapped = mod(-128, 256);
// 128