mod-op

1.0.1 • Public • Published

mod-op

Build Status npm version Dependency Status devDependency Status

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 - Number
  • divisor - Number

Example

var mod = require('mod-op');
 
var wrapped = mod(-128, 256);
// 128

Package Sidebar

Install

npm i mod-op

Weekly Downloads

87

Version

1.0.1

License

MIT

Unpacked Size

2 kB

Total Files

4

Last publish

Collaborators

  • eiriklv