All Downloads are FREE. Search and download functionalities are using the official Maven repository.

package.helpers.isInteger.js Maven / Gradle / Ivy

There is a newer version: 1.22.3
Show newest version
'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;
};





© 2015 - 2025 Weber Informatics LLC | Privacy Policy