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
wish: control of the floating point rounding mode #3526
Comments
Comment author: thelema Could the semantics of FP math in OCaml be further standardized so that each arch just needs some code to set the right flags and everyone gets the same behavior? This feature sounds like an excuse to build more incompatibilities between different architectures. |
Comment author: @xavierleroy
This is exactly what we aim for, but actually all modern platforms that we know of set the FPU to the mode we want (no exceptions, round to nearest, etc). |
Comment author: @mshinwell I don't think OCaml is going to itself provide a means of changing the rounding mode for the reason that xleroy gives above. (It does however have the -no-float-const-prop option for code doing this in C stubs.) Since there has been no further feedback on this issue for nine years, I'm closing this issue. |
Original bug ID: 3526
Reporter: administrator
Status: closed (set by @mshinwell on 2016-12-07T13:34:59Z)
Resolution: won't fix
Priority: normal
Severity: feature
Category: ~DO NOT USE (was: OCaml general)
Duplicate of: #8197 #7896
Related to: #7890
Bug description
Full_Name: Sebastian Egner
Version: Ocaml
OS: Linux/FreeBDS/Windows
Submission from: dslam164-147-59-81.dyndsl.versatel.nl (81.59.147.164)
For implementing efficient interval arithmetics it is important to have control
of the rounding mode of floating point operations. While this could be done with
calls to a C-function, the overhead would be significant---and floating point
ops would become dependent on global state. Implementing the entire interval
arithmetics as an external module in C, and linking against it, is also not a
very attractive option as the Ocalm compiler cannot fully be deployed for
optimization.
The text was updated successfully, but these errors were encountered: