Frontend/25_01_07/mai/node_modules/math-intrinsics/isInteger.js
szabomarton 7f4a15b9c3 asd
2025-01-28 11:38:27 +01:00

17 lines
410 B
JavaScript

'use strict';
var $abs = require('./abs');
var $floor = require('./floor');
var $isNaN = require('./isNaN');
var $isFinite = require('./isFinite');
/** @type {import('./isInteger')} */
module.exports = function isInteger(argument) {
if (typeof argument !== 'number' || $isNaN(argument) || !$isFinite(argument)) {
return false;
}
var absValue = $abs(argument);
return $floor(absValue) === absValue;
};