Skip to content
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

Closed
vicuna opened this Issue Mar 10, 2005 · 4 comments

Comments

Projects
None yet
1 participant
@vicuna
Copy link
Collaborator

commented Mar 10, 2005

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.

@vicuna

This comment has been minimized.

Copy link
Collaborator Author

commented Nov 22, 2007

Comment author: @Chris00

Merge with #1743

@vicuna

This comment has been minimized.

Copy link
Collaborator Author

commented Nov 26, 2007

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.

@vicuna

This comment has been minimized.

Copy link
Collaborator Author

commented Dec 2, 2007

Comment author: @xavierleroy

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 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).
The last know platform that needed additional code to get this mode was FreeBSD pre 2002. So, basically, if you have examples of modern platforms where the default floating-point mode isn't the "standard" one, please report it and we'll see what we can do.

@vicuna

This comment has been minimized.

Copy link
Collaborator Author

commented Dec 7, 2016

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.