Number.MIN_SAFE_INTEGER
상수는 JavaScript에서 안전한 최소 정수값을 나타냅니다. (-(253 - 1)
)
The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request.
Property attributes of Number.MIN_SAFE_INTEGER |
|
---|---|
Writable | no |
Enumerable | no |
Configurable | no |
설명
MIN_SAFE_INTEGER
상수는 -9007199254740991
(-9,007,199,254,740,991 또는 약 -9000조)의 값을 갖고 있습니다. 이 값의 이유는 JavaScript가 IEEE 754에 기술된 배정밀도 부동소숫점 형식 숫자체계를 사용하기 때문으로, 이로 인해 -(253 - 1)
과 253 - 1
사이의 수만 안전하게 표현할 수 있습니다.
MIN_SAFE_INTEGER
는 Number
의 정적 속성이기 때문에, 직접 생성한 Number
객체의 속성이 아니라 Number.MIN_SAFE_INTEGER
형식으로 사용해야 합니다.
설명
Number.MIN_SAFE_INTEGER // -9007199254740991
-(Math.pow(2, 53) - 1) // -9007199254740991
명세
Specification | Status | Comment |
---|---|---|
ECMAScript 2015 (6th Edition, ECMA-262) The definition of 'Number.MIN_SAFE_INTEGER' in that specification. |
Standard | Initial definition. |
ECMAScript (ECMA-262) The definition of 'Number.MIN_SAFE_INTEGER' in that specification. |
Living Standard |
브라우저 호환성
BCD tables only load in the browser
The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.