Tab Atkins Jr. (2013-07-12T18:00:09.000Z)
domenic at domenicdenicola.com (2013-07-16T00:31:37.348Z)
On Fri, Jul 12, 2013 at 10:48 AM, Allen Wirfs-Brock <allen at wirfs-brock.com> wrote: > In other words you want to define `Number.isInteger` to return `true` only if it's argument is an integer number in the range -(2^53-1)..2^53-1 > > That's a useful test and a plausible definition of `Number.isInteger` but it will also probably be surprising to programmers who are familiar with the esoterics of IEEE floats. On the other hand, people (like me) who just want to be able to tell when something is a freaking integer will be better served by these semantics. ^_^ > If we went that direction what should `Number.toInteger` do for values outside that range? The internal operation just returns `0` for things that aren't integers. I'd be okay with that, I suppose. (I use a similar function in some of my own code, and return `false` from the operation when the number cant' be converted, but that's because I use it as a combination tester and converter. We have an explicit tester, so I'm fine with the converter hiding details of its conversion.)