mod-op

Modulo operator for numbers

  • mod-op

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
mod-op
1.0.15 years ago9 years agoMinified + gzip package size for mod-op in KB

Readme

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