floor.js 295 B

12345678910111213141516
  1. 'use strict';
  2. var Type = require('./Type');
  3. // var modulo = require('./modulo');
  4. var $floor = Math.floor;
  5. // http://262.ecma-international.org/11.0/#eqn-floor
  6. module.exports = function floor(x) {
  7. // return x - modulo(x, 1);
  8. if (Type(x) === 'BigInt') {
  9. return x;
  10. }
  11. return $floor(x);
  12. };