Code coverage report for nodash/lib/integral.js

Statements: 100% (12 / 12)      Branches: 100% (4 / 4)      Functions: 100% (7 / 7)      Lines: 100% (12 / 12)      Ignored: none     

All files » nodash/lib/ » integral.js
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39      1   5   5     12       17 17       29       8 8 8       4       4          
/* vim: set et sw=2 ts=2: */
'use strict';
 
module.exports = [ 'tuple', function (tuple) {
 
  var Nodash = this;
 
  return {
 
    div: function (a, b) {
      return Math.floor(a / b);
    },
 
    quot: function (a, b) {
      var r = a / b;
      return r >= 0 ? Math.floor(r) : Math.ceil(r);
    },
    
    rem: function (a, b) {
      return a % b;
    },
 
    mod: function (a, b) {
      var q = Nodash.quot(a, b);
      var r = Nodash.rem(a, b);
      return Nodash.signum(r) === -Nodash.signum(b) ? r + b : r;
    },
    
    divMod: function (a, b)  {
      return tuple(Nodash.div(a, b), Nodash.mod(a, b));
    },
 
    quotRem: function (a, b) {
      return tuple(Nodash.quot(a, b), Nodash.rem(a, b));
    }
 
  };
}];