The following test case prints out 100 random numbers and their hex
longbits equivalents. When run with the latest Merlin builds on
Solaris with the following options suddenly the distribution is
skewed towards very small numbers (all numbers < 1E-10):
% java -d64 -Xcomp randtest
Notice that the lower 32 bits of every number are all 0 and the
exponents are all in a very narrow range which results in numbers
less than E-10.
public class randtest {
public static void main(String argv[]) {
for (int i = 0; i < 100; i++) {
double r = Math.random();
System.out.println("rand["+i+"] = "+r+" == "+
Long.toHexString(Double.doubleToLongBits(r)));
}
}
}
longbits equivalents. When run with the latest Merlin builds on
Solaris with the following options suddenly the distribution is
skewed towards very small numbers (all numbers < 1E-10):
% java -d64 -Xcomp randtest
Notice that the lower 32 bits of every number are all 0 and the
exponents are all in a very narrow range which results in numbers
less than E-10.
public class randtest {
public static void main(String argv[]) {
for (int i = 0; i < 100; i++) {
double r = Math.random();
System.out.println("rand["+i+"] = "+r+" == "+
Long.toHexString(Double.doubleToLongBits(r)));
}
}
}
- duplicates
-
JDK-4484953 Sparc V9 FXTOD instruction is very slow
-
- Resolved
-