-
Notifications
You must be signed in to change notification settings - Fork 137
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
Evaluate pi_ and other constants as floats #532
base: master
Are you sure you want to change the base?
Conversation
It seems the failure of the 32-bit tests might be due to a bug somewhere in the floating point engine. The program
gives me
on my laptop and
on the 32-bit containers. For some reason, floats are evaluated to a different precision. I am not sure if this is a bug in Form or GMP/MPFR. The internal representations are already different in evaluate.c:668. |
There is a known problem with the truncation of trailing zeros and messing up the exponent (see #492) which looks to be also the cause of the valgrind failures in your tests. So that needs to be sorted out but I didn't re-check it yet. Jos said in his slides that float mode is not expected to work properly in 32bit mode, and it seems that it will be removed/declared "unsupported" for v5 anyway. Once the valgrind errors are resolved you could also move your tests to features.frm rather than user-tests.frm. |
Printing of exponents and valgrind errors should be fixed now. 32-bit tests will probably still fail. |
This PR addresses some issues discussed during the workshop.
ee_
,em_
)Evaluate
statement to insert arbitrary precision floating point values for the three builtin constants (π
,e
,γ
). The values are provided (and cached) by MPFREvaluate
statement, e.g.Evaluate pi_
pi_*sqrt_(3)
,sqrt_(pi_)
,pi_*ee_
Furthermore, this PR fixes a bug in the printing of floating point numbers, that could cause exponents to be truncated and memory errors that would be lead to warnings in valgrind.