Re: Other class libraries

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 2008-06-27 at 10:21 +0100, Andrew John Hughes wrote:
> I thought you already had :D

No, but I did now.

- twisti

---

Index: ChangeLog
===================================================================
RCS file: /cvsroot/classpath/classpath/ChangeLog,v
retrieving revision 1.9667
diff -u -3 -p -r1.9667 ChangeLog
--- ChangeLog   30 Jun 2008 01:12:46 -0000      1.9667
+++ ChangeLog   1 Jul 2008 08:11:42 -0000
@@ -1,3 +1,8 @@
+2008-07-01  Christian Thalinger  <twisti@xxxxxxxxxxxxxxxxxxxxx>
+
+       * java/lang/Long.java (signum): Implemented properly as described
+       in Hacker's Delight Section 2-7.
+
 2008-06-30  Andrew John Hughes  <gnu_andrew@xxxxxxxxxxxxxx>
 
        PR classpath/35237:
Index: java/lang/Long.java
===================================================================
RCS file: /cvsroot/classpath/classpath/java/lang/Long.java,v
retrieving revision 1.26
diff -u -3 -p -r1.26 Long.java
--- java/lang/Long.java 18 Apr 2008 21:00:11 -0000      1.26
+++ java/lang/Long.java 1 Jul 2008 08:11:42 -0000
@@ -689,7 +689,8 @@ public final class Long extends Number i
    */
   public static int signum(long x)
   {
-    return (int)(x >> 63) - (int)(-x >> 63);
+    // Hacker's Delight, Section 2-7
+    return (int) ((x >> 63) | (-x >>> 63));
   }
 
   /**




[Index of Archives]     [Linux Kernel]     [Linux Cryptography]     [Fedora]     [Fedora Directory]     [Red Hat Development]

  Powered by Linux