Number.MIN_SAFE_INTEGER
Resum
La constant Number.MIN_SAFE_INTEGER
representa el nombre sencer segur més petit a JavaScript (-(253 - 1)
).
Property attributes of Number.MIN_SAFE_INTEGER |
|
---|---|
Writable | no |
Enumerable | no |
Configurable | no |
Descripció
La constant MIN_SAFE_INTEGER
te un valor de -9007199254740991
. El raonament darrera d'aquest nombre és que JavaScript utilitza un format de nombres de coma flotant de doble precisió, tal com s'especifica al IEEE 754 i en conseqüència només pot representar de forma segura els nombres entre -(253 - 1)
i 253 - 1
.
Degut a que MIN_SAFE_INTEGER
és una propietat estàtica de Number
, sempre s'accedeix de mitjançant Number.MIN_SAFE_INTEGER
en comptes de com una propietat d'un objecte Number
instanciat.
Exemples
Number.MIN_SAFE_INTEGER // -9007199254740991
-(Math.pow(2, 53) - 1) // -9007199254740991
Especificacions
Especificació | Estat | Comentaris |
---|---|---|
ECMAScript 2015 (6th Edition, ECMA-262) The definition of 'Number.MIN_SAFE_INTEGER' in that specification. |
Standard | Definició inicial. |
Compatibilitat amb navegadors
We're converting our compatibility data into a machine-readable JSON format.
This compatibility table still uses the old format,
because we haven't yet converted the data it contains.
Find out how you can help!
Característica | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari |
---|---|---|---|---|---|
Suport bàsic | 34 | 31 (31) | No support | (Yes) | No support |
Característica | Android | Chrome for Android | Firefox Mobile (Gecko) | IE Mobile | Opera Mobile | Safari Mobile |
---|---|---|---|---|---|---|
Suport bàsic | (Yes) | (Yes) | 32.0 (32) | No support | No support | No support |