Math.pow yields different results upon repeated calls

后端 未结 2 1850
失恋的感觉
失恋的感觉 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: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.

提交回复
热议问题