The value of floatToRawIntBits(0.0f/0.0f) is different on x86_64 and aarch64?
Tianhua huang
huangtianhua223 at gmail.com
Mon Jul 15 04:07:45 UTC 2019
Sorry, missed info: Using Scala version 2.12.8 (OpenJDK 64-Bit Server VM,
Java 1.8.0_212)
On Mon, Jul 15, 2019 at 12:05 PM Tianhua huang <huangtianhua223 at gmail.com>
wrote:
> The value of floatToRawIntBits(0.0f/0.0f) is different on x86_64 and
> aarch64? Does it depends on the platform? I think the behaviour should be
> same on different platforms, right?
>
> # on x86_64
> root at donotdel-openlab-allinone-l00242678:/home/ubuntu# uname -a
> Linux donotdel-openlab-allinone-l00242678 4.4.0-154-generic #181-Ubuntu
> SMP Tue Jun 25 05:29:03 UTC
> 2019 x86_64 x86_64 x86_64 GNU/Linux
> scala> import java.lang.Float.floatToRawIntBits
> import java.lang.Float.floatToRawIntBits
> scala> floatToRawIntBits(0.0f/0.0f)
> res0: Int = -4194304
> scala> floatToRawIntBits(Float.NaN)
> res1: Int = 2143289344
>
> # on aarch64
> [root at arm-huangtianhua spark]# uname -a
> Linux arm-huangtianhua 4.14.0-49.el7a.aarch64 #1 SMP Tue Apr 10 17:22:26
> UTC 2018 aarch64 aarch64 aarch64 GNU/Linux
> scala> import java.lang.Float.floatToRawIntBits
> import java.lang.Float.floatToRawIntBits
> scala> floatToRawIntBits(0.0f/0.0f)
> res1: Int = 2143289344
> scala> floatToRawIntBits(Float.NaN)
> res2: Int = 2143289344
>
More information about the jdk-dev
mailing list