Tab Atkins Jr. (2013-07-13T01:44:06.000Z)
On Fri, Jul 12, 2013 at 6:39 PM, Jeff Walden <jwalden+es at mit.edu> wrote:
> On 07/12/2013 06:17 PM, Tab Atkins Jr. wrote:
>> On Fri, Jul 12, 2013 at 5:15 PM, Domenic Denicola
>> <domenic at domenicdenicola.com> wrote:
>>> While I sympathize with the desire to make "integer" mean "mathematical integer," I don't think it's going to work out very well. Nobody actually cares about such functions, and you of course have the WATs of
>>>
>>> ```js
>>> Number.isInteger(9007199254740992.5) === true
>>> ```
>>>
>>> since the runtime couldn't distinguish this from `9007199254740992`.
>>
>> This is what I was trying to point out as a ridiculous possibility in
>> Jeff's idea, except he claimed it's what he actually wanted. ;_;
>
> Roughly no one will type something like that.  :-)  And if the "value" were the result of an operation that lost precision, there's no way to tell that with an API that tells you if the value was an integer.

Exactly, which is why we can only *accurately* answer for numbers <=
2^53-1.  Anything larger might have lost precision.

Technically, smaller things may lose precision as well - 2^52 + .5 ==
2^52.  But expecting precision out of decimals is a mugs game anyway.
As long as you stick to integers, you can be sure of your precision
for <= 2^53-1, but as soon as you hit 2^53, you're no longer sure.

~TJ
domenic at domenicdenicola.com (2013-07-16T00:43:38.169Z)
On Fri, Jul 12, 2013 at 6:39 PM, Jeff Walden <jwalden+es at mit.edu> wrote:

> Roughly no one will type something like that.  :-)  And if the "value" were the result of an operation that lost precision, there's no way to tell that with an API that tells you if the value was an integer.

Exactly, which is why we can only *accurately* answer for numbers <=
2^53-1.  Anything larger might have lost precision.

Technically, smaller things may lose precision as well - 2^52 + .5 ==
2^52.  But expecting precision out of decimals is a mugs game anyway.
As long as you stick to integers, you can be sure of your precision
for <= 2^53-1, but as soon as you hit 2^53, you're no longer sure.