Created
June 17, 2017 15:03
-
-
Save tennisonchan/41b1dec403fbc69ff8c581ddbc6d5518 to your computer and use it in GitHub Desktop.
MAX_SAFE_INTEGER and MIN_SAFE_INTEGER
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER | |
// Following IEEE754 [Double-precision floating-point format](https://en.wikipedia.org/wiki/Double-precision_floating-point_format) | |
// Not Support in IE | |
Number.MAX_SAFE_INTEGER // 9007199254740991 | |
Number.MIN_SAFE_INTEGER // -9007199254740991 | |
// Fun fact | |
Number.MAX_SAFE_INTEGER + 1 == Number.MAX_SAFE_INTEGER + 2 // => true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment