Math.pow yields different results upon repeated calls

后端 未结 2 1817
失恋的感觉
失恋的感觉 2021-01-18 11:53

After upgrading to Java 1.8.0_20 our test system reported errors, but the code was not changed. I found out, that Math.pow() called with exactly the same input

相关标签:
2条回答
  • 2021-01-18 12:29

    It is a bug. I reported it to ORACLE (http://bugs.java.com/bugdatabase/view_bug.do?bug_id=8063086), it was accepted and is fixed in Java 9.

    0 讨论(0)
  • 2021-01-18 12:40

    I have found the following bug report:

    JDK-7021568 : Double.parseDouble() returns architecture dependent results

    It is very similar in that it reports a floating-point operation returning slightly different results in JITed code vs interpreted code.

    The issue is marked as a bug and has been fixed. On this basis I would argue that what you're seeing is also a bug and should be reported to Oracle.

    0 讨论(0)
提交回复
热议问题