Afanasev_Stepan_PIbd-21_IP/ИП 3 лаба/node_modules/es-abstract/helpers/isInteger.js
[USERNAME] 0dd26716dc Lab2-5
2024-01-10 16:11:49 +04:00

19 lines
440 B
JavaScript

'use strict';
var GetIntrinsic = require('get-intrinsic');
var $abs = GetIntrinsic('%Math.abs%');
var $floor = GetIntrinsic('%Math.floor%');
var $isNaN = require('./isNaN');
var $isFinite = require('./isFinite');
module.exports = function isInteger(argument) {
if (typeof argument !== 'number' || $isNaN(argument) || !$isFinite(argument)) {
return false;
}
var absValue = $abs(argument);
return $floor(absValue) === absValue;
};