but was there a change in the java spec that causes the difference?
No.* According to the Javadocs for Math.pow
, a difference of up to one ULP (Unit in the Last Place) is permitted. If we take a look at your two values:
System.out.printf("%016x
", Double.doubleToLongBits(1.1567055833133086));
System.out.printf("%016x
", Double.doubleToLongBits(1.1567055833133089));
we get:
3ff281ddb6b6e675
3ff281ddb6b6e676
which indeed differ by one ULP.
What you're seeing is probably due to slight differences in the sequence of floating-point instructions used by the JDK/JVM to implement these operations.
* At least, not so far as I know!
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…