aboutsummaryrefslogtreecommitdiff
path: root/node_modules/core-js/internals/to-integer.js
blob: f7c63906f83c87f55cb883532c64c7c76582ec18 (plain)
1
2
3
4
5
6
7
8
var ceil = Math.ceil;
var floor = Math.floor;

// `ToInteger` abstract operation
// https://tc39.github.io/ecma262/#sec-tointeger
module.exports = function (argument) {
  return isNaN(argument = +argument) ? 0 : (argument > 0 ? floor : ceil)(argument);
};