Created
March 19, 2016 16:32
-
-
Save kirankumaramruthaluri/a443606741c575d76a25 to your computer and use it in GitHub Desktop.
Largest Integer Number
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
/** | |
* Largest integer number in javascript | |
* @type {number} | |
*/ | |
var x = 9007199254740992; | |
var y = -x; | |
x == x + 1; // true ! | |
y == y - 1; // also true ! | |
/** | |
* Arithmetic operators work, but bitwise/shifts only operate on int32: | |
*/ | |
x / 2; // 4503599627370496 | |
x >> 1; // 0 | |
x | 1; // 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment