mod.js 179 B

12345678
  1. 'use strict';
  2. var $floor = Math.floor;
  3. module.exports = function mod(number, modulo) {
  4. var remain = number % modulo;
  5. return $floor(remain >= 0 ? remain : remain + modulo);
  6. };