title: Why is Number.MAX_SAFE_INTEGER 9,007,199,254,740,991 and not 9,007,199,254,740,992?
body: <p>ECMAScript 6's <code>Number.MAX_SAFE_INTEGER</code> supposedly represents the maximum numerical value JavaScript can store before issues arise with floating point precision. However it's a requirement that the number 1 added to this value must also be representable as a <code>Number</code>.</p>
  <blockquote>
  <h3><code>Number.MAX_SAFE_INTEGER</code></h3>
  <p><em>NOTE The value of <code>Number.MAX_SAFE_INTEGER</code> is the largest integer <code>n</code> such that <code>n</code> and <code>n + 1</code> are both exactly representable as a <code>Number</code> value.</em></p>
  <p>The value of <code>Number.MAX_SAFE_INTEGER</code> is <code>9007199254740991 (2^53−1)</code>.</p>
  <p>– <a href="http://people.mozilla.org/%7Ejorendorff/es6-draft.html#sec-number.max_safe_integer" rel="noreferrer">ECMAScript Language Specification</a></p>
  </blockquote>
  <p>The JavaScript consoles of Chrome, Firefox, Opera and IE11 can all safely perform calculations with the number 9,007,199,254,740,992. Some tests:</p>
  <pre class="lang-js prettyprint-override"><code>// Valid
  Math.pow(2, 53)                         // 9007199254740992
  9007199254740991 + 1                    // 9007199254740992
  9007199254740992 - 1                    // 9007199254740991
  9007199254740992 / 2                    // 4503599627370496
  4503599627370496 * 2                    // 9007199254740992
  parseInt('20000000000000', 16)          // 9007199254740992
  parseInt('80000000000', 32)             // 9007199254740992
  9007199254740992 - 9007199254740992     // 0
  9007199254740992 == 9007199254740991    // false
  9007199254740992 == 9007199254740992    // true
  
  // Erroneous
  9007199254740992 + 1                    // 9007199254740992
  9007199254740993 + &quot;&quot;                   // &quot;9007199254740992&quot;
  9007199254740992 == 9007199254740993    // true
  </code></pre>
  <p>Why is it a requirement that <code>n + 1</code> must also be representable as a <code>Number</code>? Why does failing this make the value <em>unsafe</em>?</p>