-
-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Limited to Number.isSafeInteger
values
#17
Comments
Javascript Infinity is not equal Infinity in Math. |
you may need another function like
|
@yinsang The stated goal of this library, from the readme:
This library was designed to bypass unintuitive limits/deficiencies with the native JS handling of numbers. Large numbers returning false is another one of those limits, and if it's not going to be handled, it should be documented as something that is not supported for the library. It shouldn't remain an undocumented mystery that people have to trip over to find out. Furthermore, Infinity is never a number, it's a concept. You can't just hand-wave it as "JS understand it as an Infinity number", that's not a good excuse. "Infinity number" isn't a thing. Either something is a number, or it's Infinity. Large numbers don't stop being numbers and don't magically become Infinity just because of a defect in the programming language. |
without guess, we need author's response. |
It should probably be mentioned somewhere that this returns false for integer strings that are outside
Number.MAX_SAFE_INTEGER
andNumber.MIN_SAFE_INTEGER
, due toNumber.isFinite
not being able to handle large integers. e.g.:The text was updated successfully, but these errors were encountered: