[External] : Re: Classfile API tracking RFEs
Adam Sotona
adam.sotona at oracle.com
Wed Mar 8 08:19:00 UTC 2023
On 08.03.2023 8:23, "Michael van Acken" <michael.van.acken at gmail.com> wrote:
Am Mi., 8. März 2023 um 08:05 Uhr schrieb Adam Sotona <adam.sotona at oracle.com<mailto:adam.sotona at oracle.com>>:
Oh, and constantInstruction() properly handling -0.0d and -0.0f would be nice. This is the
one patch I have been carrying around since the very beginning that has not been resolved.
-- mva
Hi Michael,
Do you know some cases of -0.0d and -0.0f wrong handling?
I don't quite understand the question.
Negative zero compares as ==-equal to positive zero under IEEE-754, but
the two are distinct bit patterns. Both javac and jshell treat them as distinct,
as do equals() and compareTo().
jshell> 0.0f == -0.0f
$3 ==> true
jshell> Float.floatToRawIntBits(0.0f)
$4 ==> 0
jshell> Float.floatToRawIntBits(-0.0f)
$5 ==> -2147483648
The current constantInstruction would lead to a different output for the last line,
by squashing the value to 0.0f.
-- mva
Thanks for pointing it out, I’ve added test and fixed it, see:
https://github.com/openjdk/jdk/pull/10982/commits/65a69135f6623e0f78aeaf8cd7b2ebdc8e1bbb27
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/classfile-api-dev/attachments/20230308/b7e79b49/attachment.htm>
More information about the classfile-api-dev
mailing list