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

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

    XMLWordPrintable

Details

    • sparc
    • solaris_2.5

    Description



      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

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

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: