Math.round(Float.NaN) returns Integer.MAX_VALUE instead of 0

XMLWordPrintable

    • sparc
    • solaris_2.5



      Name: mgC56079 Date: 09/20/98



      According to the JLS 20.11.18 Math.round(Float.NaN) should return 0.

      === Here is the test ===
      public class Round {
          public static void main(String args[]) {
              System.out.println(Math.round(Float.NaN));
          }
      }
      === Sample run ===
      % java Round
      2147483647

      ======================================================================

            Assignee:
            Joe Darcy
            Reporter:
            Mikhail Gorshenev (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: