I have a very simple test case Javathat calls Math.exp(double), and then StrictMath.exp(double)for some reason, I canβt understand that the result is different from Java 8, despite the fact that JDKit Math.expjust delegates from the source code StrictMath.exp.
public static void main(String[] args) {
Properties p = System.getProperties();
System.out.println(p.get("java.runtime.version"));
System.out.println(p.get("java.specification.version"));
System.out.println(Math.exp(1d));
System.out.println(StrictMath.exp(1d));
}
result Java 8:
1.8.0_66-b18
1.8
null
2.718281828459045
2.7182818284590455
and Java 7:
1.7.0_21-b11
1.7
2.7182818284590455
2.7182818284590455
Any pointers appreciated are more out of curiosity than any real issue.
source
share