On Tue, 2005-12-06 at 11:12 -0700, Tom Tromey wrote:
> >>>>> "Anthony" == Anthony Green <[EMAIL PROTECTED]> writes:
> 
> Anthony> This patch makes sure FloatBuffer and DoubleBuffer objects compare
> Anthony> properly when they contain NaN values.  I've already checked in Mauve
> Anthony> tests cases.  Ok to commit?
> 
> Does it do the right thing if a is NaN and b is not?  Or vice versa?
> If so, this is ok.

Yes, definitely.  Although I have what is probably an even simpler patch
now.  I'll commit the following later tomorrow unless there are
objections.


Index: java/nio/FloatBuffer.java
===================================================================
RCS file: /cvsroot/classpath/classpath/java/nio/FloatBuffer.java,v
retrieving revision 1.20
diff -u -r1.20 FloatBuffer.java
--- java/nio/FloatBuffer.java   2 Jul 2005 20:32:39 -0000       1.20
+++ java/nio/FloatBuffer.java   7 Dec 2005 02:46:34 -0000
@@ -303,8 +303,12 @@
           
        if (a < b)
          return -1;
-          
-       return 1;
+
+       if (a > b)
+         return 1;
+
+       // Otherwise a and b must both be NaN and we can continue
+       // looping.
       }
       
     return remaining() - other.remaining();


(and similarly for DoubleBuffer.java)





_______________________________________________
Classpath-patches mailing list
Classpath-patches@gnu.org
http://lists.gnu.org/mailman/listinfo/classpath-patches

Reply via email to