-
Notifications
You must be signed in to change notification settings - Fork 148
Evaluate pi_ and other constants as floats #532
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
Conversation
dfd5fcf to
66d0b4e
Compare
|
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. |
|
@fllor I can't see the logs for the failed tests any more, but I expect you just need to add |
|
Maybe use |
|
Could you squash this into a "feature" and "tests" commit? I think it should be good for merge then. |
- Add builtin symbols for Euler's number (ee_) and Euler-Mascheroni-constant (em_) - Allow 'Evaluate' to expand builtin symbols (pi_,ee_,em_) numerically - Remove some unused/obsolete code related to floating point numbers - Documentation - Fix printing of floating point numbers (sources/float.c:PrintFloat)
This PR addresses some issues discussed during the workshop.
ee_,em_)Evaluatestatement to insert arbitrary precision floating point values for the three builtin constants (π,e,γ). The values are provided (and cached) by MPFREvaluatestatement, 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.