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

narrowing from float -NaN to int should produce constant 0

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P3 P3
    • None
    • 1.4.1
    • hotspot
    • None
    • generic
    • solaris_8

      javac fails jacks test

      ==== 5.1.3-nan-1 narrowing from float NaN to int produces 0 FAILED
      ==== Contents of test case:

          constant_expression T513nan1 {(int) Float.NaN == 0} {(int) -Float.NaN == 0}

      ---- Result was:
      FAIL
      ---- Result should have been:
      PASS
      ==== 5.1.3-nan-1 FAILED


      ==== 5.1.3-nan-2 narrowing from double NaN to int produces 0 FAILED
      ==== Contents of test case:

          constant_expression T513nan2 {(int) Double.NaN == 0} {(int) -Double.NaN == 0}

      ---- Result was:
      FAIL
      ---- Result should have been:
      PASS
      ==== 5.1.3-nan-2 FAILED


            gafter Neal Gafter (Inactive)
            gafter Neal Gafter (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: