I have a very simple Java
test case which calls Math.exp(double)
and then StrictMath.exp(double)
and for a reason I can't understand the result is different on Java 8
despite the fact that from JDK
source code it appears that Math.exp
simply delegates to 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 on Java 8
:
1.8.0_66-b18
1.8
null
2.718281828459045
2.7182818284590455
and on Java 7
:
1.7.0_21-b11
1.7
2.7182818284590455
2.7182818284590455
Any pointers appreciated, more out of curiosity than any real issue.