JavaScript, ECMAScript, MAX_SAFE_INTEGER, math symbols β π½ (2026)
JavaScript question about MAX_SAFE_INTEGER and what i learned
massive tech geeking on JavaScript.
the question is, js spec says:
Number.MAX_SAFE_INTEGER is the largest integer n such that n and n + 1 are both exactly representable as a Number value.
why the n+1 ?
i asked ai. and learned several things.
- AI helped me understand the issue. amazing ai!
- AI cited my website xahlee.info by chance. lol. funny.
- via ai, discovered that the js spec later used different wording, so that it entirely avoided the question about n+1. this is a great find. it showed how great technical writing matters. and also, it shows, that the ECMAScript people improved writing, indeed, some people cared.
- another discovery is that the js spec started to use unicode math symbols β π½, and also, used them in a unusual fashion.
AI sites xahlee info
ECMAScript 2015
here's ECMAScript 2015:
ECMAScript 2021
here's ECMAScript 2021.
note, interesting that they used unicode β from math for real numbers, but used it in a odd way, like a function name. they also used π½, for finite field. funny.
ECMAScript 2026
this is ECMAScript 2026 definition:
An integer n is a "safe integer" if and only if the Number value for n is not the Number value for any other integer.
this definition much more intutive. they made the change sometimes after 2021 edition.
math symbols real β and finite field π½
here's a passage where they defined how they use these symbols.