-
Notifications
You must be signed in to change notification settings - Fork 154
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
Doubles are imprecise #99
Comments
Well I just saw you added usesHighPrecisionEvaluation. It seems to fix the issue with stringValue but doesn't fix it with doubleValue |
What Every Computer Scientist Should Know About Floating-Point Arithmetic Short of writing my own infinite-precision math framework, I'm not sure there's a way to "solve" this. |
What about porting/wrapping one of the infinite-precision math framework written in C/C++? I have been toying with the idea every since you started the Swift branch. Someone just needs to find the time. ;) One of the candidates is MAPM. |
I would love to see an infinite-precision implementation here. In testing, I'm seeing: 45.25 - 45 = 0.230000000000004. Any easy fix? |
No, this is not an easy fix. I'm waiting to implement this until Swift has a standardized "BigNum" library. I've thought about making |
Thanks Dave. Definitely looking forward to this very much as it's the only weakness in your otherwise amazing library. |
Hi, first thanks for this great library but I have a problem which actually seems well known with NSNumber.
When I evaluate a simple string through evaluateString like "1.2*6", the result is as expected 7.2 but when I call stringValue on this NSNumber(double), I get "7.199999999999999" or 7.1999999999999993 if I use doubleValue.
How can I do?
Thanks for your help
The text was updated successfully, but these errors were encountered: