Win32 only: (double value >= NaN) returns true it should not.

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P2
    • 1.1
    • Affects Version/s: 1.0
    • Component/s: hotspot
    • 1.1
    • x86
    • windows_nt
    • Not verified

      Win32 only: double >= NaN returns true. It should not.
      NaN should not be ordered, so any comparison except != should return false. Same
      problem with Float.NaN.

      Steps to reproduce
      Compile and run the attached code
      Note: you should not see the Warning message.

      public class FloatTest2
      {
         public static void main(String argv[])
         {
            double x = 3.1415926;
            double y = Double.NaN;

            System.out.println( "x == " + x );
            System.out.println( "y == " + y );
            System.out.println( ! ( x < y ) );
            System.out.println( x >= y );

            if ( (!( x < y ) ) == ( x >= y ) )
               System.out.println( "Warning! !(x<y) should not equal (x>=y)");

         }
      }

            Assignee:
            Eric Gilbertson (Inactive)
            Reporter:
            Kevin Smith (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: