On Wed, 13 Jul 2022 13:11:33 GMT, Raffaello Giulietti <d...@openjdk.org> wrote:
>> Initial implementation. > > src/java.base/share/classes/java/lang/Float.java line 1174: > >> 1172: >> 1173: short result = 0; >> 1174: result = (short)(((exp + 15) << 10) | signif_bits); > > result = (short)(((exp + 15) << 10) + signif_bits); > > The final exponent needs to be incremented when `signif_bits == 0x400`. The > `|` is not enough for this to happen. Good catch; I'll correct this bug in the next push. I'll be adding a test to verify correct rounding of all the values in a binade - the set of floating-point values with the same exponent. That test reveals this issue. ------------- PR: https://git.openjdk.org/jdk/pull/9422