-
-
Notifications
You must be signed in to change notification settings - Fork 14
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
Trig functions result in floating point error #36
Comments
Not really sure how to fix that, any ideas? |
To prevent this from going stale I'll update, but I don't really have a simple and satisfying solution yet... A few options are
|
I probably won't work on this, but would welcome a PR. fend is a great alternative to try out, trigonometry seems to work there One thing about other decimal libraries is some have a much smaller range of possible numbers |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description: using "pi" with trig functions results in close but wrong floating point results
Steps to reproduce:
cpc 'sin(pi)'
orcpc 'sin(pi/2)'
Expected result:
0
and1
respectivelyActual result:
5.012535993076719585277299108368256E-35
and1.000000000000000000000000000000001
The text was updated successfully, but these errors were encountered: