kchapelier / node-mathp

Math utility for node
MIT License
9 stars 1 forks source link

Add isInteger #10

Closed megawac closed 9 years ago

megawac commented 9 years ago

Your indentation is making my editor go insane :/ ill fix that later if you approve

Relevant es-discuss https://mail.mozilla.org/pipermail/es-discuss/2013-August/032991.html

kchapelier commented 9 years ago

What's the issue with the indentation ? If it's the tabs in the test files, they weren't supposed to be there anymore but I forgot to apply the new code style there. Otherwise adding an .editorconfig file might help, I'll look into that.

It looks like the native implementation in node 0.11 considers number over 2 * 53 to be valid integers. The MDN copy of the language spec has one method isInteger() and one isSafeInteger(). The MDN wiki has both method but the polyfill for isInteger() still checks for 2 * 53. It might be a recent change to the spec.

kchapelier commented 9 years ago

I'll merge it in and try to adapt it to be identical to the current spec.