Skip to content

Instantly share code, notes, and snippets.

@kirantemojo
Created March 19, 2016 16:32
Show Gist options
  • Save kirantemojo/a443606741c575d76a25 to your computer and use it in GitHub Desktop.
Save kirantemojo/a443606741c575d76a25 to your computer and use it in GitHub Desktop.
Largest Integer Number
/**
* 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