Number.MIN_SAFE_INTEGER
代表在 JavaScript中最小的安全的integer型数字 (-(253 - 1)
).
Number.MIN_SAFE_INTEGER 属性的属性特性: |
|
---|---|
writable | false |
enumerable | false |
configurable | false |
描述
MIN_SAFE_INTEGER
的值是-9007199254740991
. 形成这个数字的原因是 JavaScript 在 IEEE 754中使用double-precision floating-point format numbers 作为规定。在这个规定中能安全的表示数字的范围在-(253 - 1)
到 253 - 1之间
.
由于MIN_SAFE_INTEGER
是Number
的属性。
示例
Number.MIN_SAFE_INTEGER // -9007199254740991 -(Math.pow(2, 53) - 1) // -9007199254740991
规范
Specification | Status | Comment |
---|---|---|
ECMAScript 2015 (6th Edition, ECMA-262) Number.MIN_SAFE_INTEGER |
Standard | Initial definition. |
ECMAScript Latest Draft (ECMA-262) Number.MIN_SAFE_INTEGER |
Draft |
浏览器支持
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!
Update compatibility data on GitHub
Desktop | Mobile | Server | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
MIN_SAFE_INTEGER |
Chrome Full support 34 | Edge Full support 12 | Firefox Full support 31 | IE No support No | Opera Full support Yes | Safari Full support 9 | WebView Android Full support Yes | Chrome Android Full support 34 | Firefox Android Full support 31 | Opera Android Full support Yes | Safari iOS Full support 9 | Samsung Internet Android Full support Yes | nodejs Full support 0.12 |
Legend
- Full support
- Full support
- No support
- No support