Jorge Chamorro (2013-07-12T23:35:54.000Z)
On 13/07/2013, at 01:24, Jeff Walden wrote:

> On 07/12/2013 04:13 PM, Tab Atkins Jr. wrote:
>> 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?
> 
> All numbers >= 2**53 except Infinity, yes.  I think "isInteger" implies the mathematical concept, with the only addition that it should pass -0.  And while it would somewhat unfortunately diverge from the ToInteger spec operation, "toInteger" should imply the mathematical concept as well, and only produce values that are mathematical integers.  ("toInteger" should probably convert -0 to -0 for consistency with "isInteger" on -0, but probably I could go either way here.)

Everything from Math.pow(2,52) to Math.pow(2,53) are integers (if represented as IEE-754 doubles), because there's no bit left to represent Math.pow(2,-1):

Math.pow(2,52)
4503599627370496

Math.pow(2,52).toString(2)
"10000000000000000000000000000000000000000000000000000"

Math.pow(2,52).toString(2).length
53

(Math.pow(2,52)-1).toString(2)
"1111111111111111111111111111111111111111111111111111"

(Math.pow(2,52)-1).toString(2).length
52

Math.pow(2,52)-0.5
4503599627370495.5

Math.pow(2,52)+0.5
4503599627370496

-- 
( Jorge )();
domenic at domenicdenicola.com (2013-07-16T00:38:41.278Z)
On 13/07/2013, at 01:24, Jeff Walden wrote:

> On 07/12/2013 04:13 PM, Tab Atkins Jr. wrote:
>> 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?
> 
> All numbers >= 2^53 except Infinity, yes.  I think "isInteger" implies the mathematical concept, with the only addition that it should pass -0.  And while it would somewhat unfortunately diverge from the ToInteger spec operation, "toInteger" should imply the mathematical concept as well, and only produce values that are mathematical integers.  ("toInteger" should probably convert -0 to -0 for consistency with "isInteger" on -0, but probably I could go either way here.)

Everything from `Math.pow(2,52)` to `Math.pow(2,53)` are integers (if represented as IEE-754 doubles), because there's no bit left to represent `Math.pow(2,-1)`:

```
Math.pow(2,52)
4503599627370496

Math.pow(2,52).toString(2)
"10000000000000000000000000000000000000000000000000000"

Math.pow(2,52).toString(2).length
53

(Math.pow(2,52)-1).toString(2)
"1111111111111111111111111111111111111111111111111111"

(Math.pow(2,52)-1).toString(2).length
52

Math.pow(2,52)-0.5
4503599627370495.5

Math.pow(2,52)+0.5
4503599627370496
```