1 |
3a515b92
|
cagy
|
'use strict';
|
2 |
|
|
|
3 |
|
|
var GetIntrinsic = require('../GetIntrinsic');
|
4 |
|
|
|
5 |
|
|
var $Math = GetIntrinsic('%Math%');
|
6 |
|
|
|
7 |
|
|
var $floor = $Math.floor;
|
8 |
|
|
var $abs = $Math.abs;
|
9 |
|
|
|
10 |
|
|
var $isNaN = require('../helpers/isNaN');
|
11 |
|
|
var $isFinite = require('../helpers/isFinite');
|
12 |
|
|
|
13 |
|
|
// https://www.ecma-international.org/ecma-262/6.0/#sec-isinteger
|
14 |
|
|
|
15 |
|
|
module.exports = function IsInteger(argument) {
|
16 |
|
|
if (typeof argument !== 'number' || $isNaN(argument) || !$isFinite(argument)) {
|
17 |
|
|
return false;
|
18 |
|
|
}
|
19 |
|
|
var abs = $abs(argument);
|
20 |
|
|
return $floor(abs) === abs;
|
21 |
|
|
};
|