You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
514 B
21 lines
514 B
'use strict';
|
|
|
|
var GetIntrinsic = require('../GetIntrinsic');
|
|
|
|
var $Math = GetIntrinsic('%Math%');
|
|
|
|
var $floor = $Math.floor;
|
|
var $abs = $Math.abs;
|
|
|
|
var $isNaN = require('../helpers/isNaN');
|
|
var $isFinite = require('../helpers/isFinite');
|
|
|
|
// https://www.ecma-international.org/ecma-262/6.0/#sec-isinteger
|
|
|
|
module.exports = function IsInteger(argument) {
|
|
if (typeof argument !== 'number' || $isNaN(argument) || !$isFinite(argument)) {
|
|
return false;
|
|
}
|
|
var abs = $abs(argument);
|
|
return $floor(abs) === abs;
|
|
};
|
|
|