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
Scala should have a @Strictfp annotation #1708
Comments
Imported From: https://issues.scala-lang.org/browse/SI-1708?orig=1 |
@dragos said: public strictfp class FPTest {
public static void main(String[] args) {
double d = 8e+307;
System.out.println(4.0 * d * 0.5);
System.out.println(2.0 * d);
}
} There seems to be no equivalent on .NET, so this will have an effect only on jvm targets. |
@SethTisue said: |
@dragos said: |
@paulp said: |
@SethTisue said: I think this ticket should remain open as a requested enhancement. I think assigning it to scala_community would be reasonable. |
@paulp said:
That's fine if the ticket feels slighted, but you're going the wrong way: "closed with needinfo status" means "I will work on this if I am supplied with info" whereas "open and assigned to scala_community" means "nobody is likely to work on this." |
@SethTisue said: |
@SethTisue said: |
(Jorge Ortiz suggested I file this ticket)
strictfp has been around for over 10 years -- since Java 1.2.
It's important to some scientific users. Supporting strictfp
is part of Scala's capabilities being a superset of Java's.
Most users justifiably don't care, but if you're doing some kinds of
scientific computing, then exact reproducibility of floating point
results cross-platform is important. For example, in our simulation
tool NetLogo, we promise users that if they run their simulation with
the same random seed, they'll get the same results every time, no matter
what computer they're on. This ensures that published simulation
results can be reproduced. And that promise rests on Java's strictfp
promise.
It's also convenient for testing purposes (in any application domain)
not to have to worry about whether results can vary slightly from
machine to machine.
It would certainly be nice if Scala supported strictfp declarations (an
annotation instead of a keyword would be fine. I imagine Java would
java done it that way if annotations existed at the time). I don't have any actual
simulation engine code in Scala right now, but when I do, I guess I'll
have to find a way to post-process the class files generated by scalac
in order to set the strictfp flag myself.
The text was updated successfully, but these errors were encountered: