T
tzvika.barenholz
Hi all
I've been puzzled by the strictfp modifier. according to JLS , unless
it is specified, the JVM *may* use more precision for intermediate
calculations. For example running the following:
public class StrictFpExample {
public static void main(String[] args) {
double x =3.e-300;
double y= x*x/x;
System.out.println(x);
System.out.println(y);
}
}
should resyult in y being 3e-300, not 0.
unfortunately, testing this both with and without strictfp, you get y=0
anyway.
I imagine if they put it in, there should be a difference.
any idea? can anyone come up with en example that shows a difference?
p.s. this is on 1.5.02
thx
Tzvika
I've been puzzled by the strictfp modifier. according to JLS , unless
it is specified, the JVM *may* use more precision for intermediate
calculations. For example running the following:
public class StrictFpExample {
public static void main(String[] args) {
double x =3.e-300;
double y= x*x/x;
System.out.println(x);
System.out.println(y);
}
}
should resyult in y being 3e-300, not 0.
unfortunately, testing this both with and without strictfp, you get y=0
anyway.
I imagine if they put it in, there should be a difference.
any idea? can anyone come up with en example that shows a difference?
p.s. this is on 1.5.02
thx
Tzvika