Interface NumberConstructor
new NumberConstructornew (value?: any): Number;
EPSILON: number;
MAX_SAFE_INTEGER: number;
MAX_VALUE: number;
MIN_SAFE_INTEGER: number;
MIN_VALUE: number;
NaN: number;
NEGATIVE_INFINITY: number;
POSITIVE_INFINITY: number;
prototype: Number;
isFinite(number: unknown): boolean;
isInteger(number: unknown): boolean;
isNaN(number: unknown): boolean;
isSafeInteger(number: unknown): boolean;
parseFloat(string: string): number;
parseInt(string: string, radix?: number): number;
(value?: any): number;
}
Index
Constructors
Properties
Methods
Properties
Readonly
EPSILON
Readonly
MAX_SAFE_INTEGER
The value of the largest integer n such that n and n + 1 are both exactly representable as a Number value. The value of Number.MAX_SAFE_INTEGER is 9007199254740991 2^53 − 1.
Readonly
MAX_VALUE
The largest number that can be represented in JavaScript. Equal to approximately 1.79E+308.
Readonly
MIN_SAFE_INTEGER
The value of the smallest integer n such that n and n − 1 are both exactly representable as a Number value. The value of Number.MIN_SAFE_INTEGER is −9007199254740991 (−(2^53 − 1)).
Readonly
MIN_VALUE
The closest number to zero that can be represented in JavaScript. Equal to approximately 5.00E-324.
Readonly
NaN
A value that is not a number. In equality comparisons, NaN does not equal any value, including itself. To test whether a value is equivalent to NaN, use the isNaN function.
Readonly
NEGATIVE_INFINITY
A value that is less than the largest negative number that can be represented in JavaScript. JavaScript displays NEGATIVE_INFINITY values as -infinity.
Readonly
POSITIVE_INFINITY
A value greater than the largest number that can be represented in JavaScript. JavaScript displays POSITIVE_INFINITY values as infinity.
Readonly
prototype
Methods
isFinite
isInteger
isNaN
- is
NaN (number): boolean Returns a Boolean value that indicates whether a value is the reserved value NaN (not a number). Unlike the global isNaN(), Number.isNaN() doesn't forcefully convert the parameter to a number. Only values of the type number, that are also NaN, result in true.
Parameters
- number: unknown
A numeric value.
Returns boolean
- number: unknown
isSafeInteger
parseFloat
parseInt
- parse
Int (string, radix?): number Converts A string to an integer.
Parameters
- string: string
A string to convert into a number.
Optional
radix: numberA value between 2 and 36 that specifies the base of the number in
string
. If this argument is not supplied, strings with a prefix of '0x' are considered hexadecimal. All other strings are considered decimal.
Returns number
- string: string
The value of Number.EPSILON is the difference between 1 and the smallest value greater than 1 that is representable as a Number value, which is approximately: 2.2204460492503130808472633361816 x 10−16.