Hacker News new | ask | show | jobs
by seritools 1942 days ago
Ah, now I see it the whole point - "reliably representable" not meaning the same as "safe", gotcha.
1 comments

Sort of. I'm pointing out what seems to me to be an incorrect statement in the article. I think it's reasonable to have special terminology for the sequence of contiguous integers which can be represented exactly in the Number type. Safe seems a reasonable choice, provided it's used carefully.

MAX_SAFE_INTEGER seems a better choice of identifier than something like MAX_VALUE_OF_EXACTLY_REPRESENTABLE_CONTIGUOUS_SEQUENCE_OF_INTEGERS, of course, despite that it's less precise. (Even that absurdly long identifier isn't perfectly precise, as we can define a trivial sequence of a single value like Number.MAX_VALUE.) The documentation explaining it should be precise, though.