Tab Atkins Jr. (2013-07-12T17:27:20.000Z)
On Fri, Jul 12, 2013 at 10:19 AM, Mark S. Miller <erights at google.com> wrote:
> No. Even if toInteger meant "no fractional component", I would still expect
> it only to return true if there is some specific mathematical integer that
> the JS number can be said to exactly represent. For the same reason, I think
> isInteger(-0) should be true and isInteger(NaN) should be false.

Agreed.  isInteger() has one job, and it's kinda worthless if it can't
even do that.  How it should be:

Number.isInteger(-0) == true
Number.isInteger(NaN) == false
Number.isInteger(Infinity) == false

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

~TJ
domenic at domenicdenicola.com (2013-07-15T22:45:08.957Z)
On Fri, Jul 12, 2013 at 10:19 AM, Mark S. Miller <erights at google.com> wrote:
> No. Even if `toInteger` meant "no fractional component", I would still expect
> it only to return true if there is some specific mathematical integer that
> the JS number can be said to exactly represent. For the same reason, I think
> `isInteger(-0)` should be `true` and `isInteger(NaN)` should be `false`.

Agreed.  `isInteger()` has one job, and it's kinda worthless if it can't
even do that.  How it should be:

```js
Number.isInteger(-0) == true
Number.isInteger(NaN) == false
Number.isInteger(Infinity) == false
```

And, because of what we discussed in the recent thread...

```js
Number.isInteger(Math.pow(2,53)-1) == true
Number.isInteger(Math.pow(2,53)) == false
```