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

static method doubleToLongBits(double value) in class Double Does not give corre

    XMLWordPrintable

Details

    • 1.1fcs
    • sparc
    • solaris_2.4
    • Not verified

    Description

      static Method doubleToLongBits(double value) in class Double returns wrong results when value = Double.NaN and any Valid double. See Following test program

      public class DoubleTest {

        public static void main(String[] argv) {

          long l;
          // Test For NaN
          l = Double.doubleToLongBits(Double.NaN);
          if ( l != 0x7ff8000000000000L)
            System.out.println("Test Failed for NaN");
          else
            System.out.println("Test Passed for NaN");

        }
      }

      Attachments

        Activity

          People

            sliangsunw Sheng Liang (Inactive)
            duke J. Duke
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: