-
-
Notifications
You must be signed in to change notification settings - Fork 442
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
Floating point precision - does/ will this library support this? #13
Comments
@bguiz Yeah, thanks for the question. This behavior is expected.
This is not because JavaScript implementors have failed to properly implement floating-point math. The reason the answer is not exactly In general, this type of imprecision is not an issue, as floating-point rounding errors tend to cancel out. What we are concerned about is the types of algorithms used to implement basic math functions, such as trig and other special functions. The errors arising from these algorithms are of a different kind than the errors arising from floating-point math. To "address" floating-point errors, you can use symbolic or arbitrary precision arithmetic libraries, which is not currently within the scope of this library, but may at some point in the future. |
Thanks for the answer!
With the name |
@bguiz Agreed. These libraries would be nice to have, but we first want to cover all our bases and get the basics right before moving on to higher order concerns. Much to do, so little time! Also, if you have any other general questions, feel free to also seek us out and leave a message on Gitter. |
@kgryte Thanks for the quick merge earlier!
I have a question - is it the intent of this library's math section to provide a means to solve the floating point precision problems in JS?
A concise demonstration of what I'm referring to:
I came across this lib linked from this article and while reading it, this came to mind immediately.
... and that paragraph implied that you have solved (or are aiming to solve) this very problem, which I believe is an baseline factor that tends to affect precision in any non-integer math in JS. I've tried looking for references to this specific issue in this lib (and its FAQ), but have not been able to find reference to it yet.
Checklist
RFC:
.Description
Does this lib provide a means to solve this?
Related Issues
None.
Questions
Yes, see above.
Other
Demo
Not applicable.
Reproduction
Not applicable.
Expected Results
The following results are expected:
Actual Results
The following are the actual results:
Environments
v8, likely all JS engine implementations
The text was updated successfully, but these errors were encountered: