Tab Atkins Jr. (2013-07-12T23:13:10.000Z)
On Fri, Jul 12, 2013 at 3:54 PM, Jeff Walden <jwalden+es at mit.edu> wrote:
> On 07/12/2013 10:27 AM, Tab Atkins Jr. wrote:
>> And, because of what we discussed in the recent thread...
>>
>> Number.isInteger(Math.pow(2,53)-1) == true
>> Number.isInteger(Math.pow(2,53)) == false
>
> I need to comment in the other thread again and push back against what people have said there, but that thread's issues aside entirely, this is very very wrong.  2**53 is an integer.  That there are multiple mathematical integer values that, when converted to IEEE-754 format, are equal to 2**53 is irrelevant.  An integer value, that operations claim is not an integer, is very very wat.

2^53 + 2 is also an integer, but it's clearly outside the range of
*exactly-representable integers*, where each integer has one and only
one representation.  You can't tell if the number you got is actually
2^53+2 or not - it might have been input as 2^53+3, or 2^53+.1, or any
number of other starting inputs.

If you agree with that reasoning that 2^53+2 should return false from
isInteger(), then you must agree that 2^53 should also return false.

If you don't agree with that reasoning, then I suppose you'd argue
that *all* numbers > 2^53 should return true, since they're all forced
into being represented as integers?

If neither of these describe your position, could you explain your
position in more detail?

~TJ
domenic at domenicdenicola.com (2013-07-16T00:36:00.656Z)
On Fri, Jul 12, 2013 at 3:54 PM, Jeff Walden <jwalden+es at mit.edu> wrote:
> I need to comment in the other thread again and push back against what people have said there, but that thread's issues aside entirely, this is very very wrong.  2^53 is an integer.  That there are multiple mathematical integer values that, when converted to IEEE-754 format, are equal to 2^53 is irrelevant.  An integer value, that operations claim is not an integer, is very very wat.

2^53 + 2 is also an integer, but it's clearly outside the range of
*exactly-representable integers*, where each integer has one and only
one representation.  You can't tell if the number you got is actually
2^53+2 or not - it might have been input as 2^53+3, or 2^53+.1, or any
number of other starting inputs.

If you agree with that reasoning that 2^53+2 should return `false` from
`isInteger()`, then you must agree that 2^53 should also return `false`.

If you don't agree with that reasoning, then I suppose you'd argue
that *all* numbers > 2^53 should return `true`, since they're all forced into being represented as integers?

If neither of these describe your position, could you explain your
position in more detail?