Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8249275

Values of floatToRawIntBits(0.0f/0.0f) are different on x86_64 and aarch64

    Details

      Description


                                      
      A DESCRIPTION OF THE PROBLEM :
      The value of floatToRawIntBits(0.0f/0.0f) is different on x86_64 and aarch64:

      # on x86_64
      root@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@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

      I think the behaviour should be same on aarch64 and x86_64?

        Attachments

          Activity

            People

            • Assignee:
              tongwan Andrew Wang
              Reporter:
              sswsharm swati sharma
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: