[kaffe] CVS kaffe (robilad): Resynced with GNU Classpath: small cleanup in java.math

Kaffe CVS cvs-commits at kaffe.org
Thu Oct 14 13:28:12 PDT 2004


PatchSet 5288 
Date: 2004/10/14 20:23:58
Author: robilad
Branch: HEAD
Tag: (none) 
Log:
Resynced with GNU Classpath: small cleanup in java.math

2004-10-14  Dalibor Topic <robilad at kaffe.org>

        * libraries/javalib/java/math/BigDecimal.java,
        libraries/javalib/java/math/BigInteger.java:
        Resynced with GNU Classpath.

        2004-10-13  Michael Koch  <konqueror at gmx.de>

        * java/math/BigDecimal.java, java/math/BigInteger.java:
        Reorganized import statements, removed redundant and reorganized
        modifiers.

Members: 
	ChangeLog:1.2840->1.2841 
	libraries/javalib/java/math/BigDecimal.java:1.10->1.11 
	libraries/javalib/java/math/BigInteger.java:1.28->1.29 

Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.2840 kaffe/ChangeLog:1.2841
--- kaffe/ChangeLog:1.2840	Thu Oct 14 19:42:55 2004
+++ kaffe/ChangeLog	Thu Oct 14 20:23:58 2004
@@ -1,5 +1,17 @@
 2004-10-14  Dalibor Topic <robilad at kaffe.org>
 
+	* libraries/javalib/java/math/BigDecimal.java,
+	libraries/javalib/java/math/BigInteger.java:
+        Resynced with GNU Classpath.
+
+	2004-10-13  Michael Koch  <konqueror at gmx.de>
+
+        * java/math/BigDecimal.java, java/math/BigInteger.java:
+        Reorganized import statements, removed redundant and reorganized
+        modifiers.
+
+2004-10-14  Dalibor Topic <robilad at kaffe.org>
+
 	* libraries/javalib/java/util/zip/GZIPInputStream.java,
 	libraries/javalib/java/util/zip/GZIPOutputStream.java:
         Resynced with GNU Classpath.
Index: kaffe/libraries/javalib/java/math/BigDecimal.java
diff -u kaffe/libraries/javalib/java/math/BigDecimal.java:1.10 kaffe/libraries/javalib/java/math/BigDecimal.java:1.11
--- kaffe/libraries/javalib/java/math/BigDecimal.java:1.10	Mon Jul 26 21:13:56 2004
+++ kaffe/libraries/javalib/java/math/BigDecimal.java	Thu Oct 14 20:24:05 2004
@@ -37,28 +37,26 @@
 
 package java.math;
 
-import java.math.BigInteger;
-
 public class BigDecimal extends Number implements Comparable
 {
   private BigInteger intVal;
   private int scale;
   private static final long serialVersionUID = 6108874887143696463L;
 
-  private final static BigDecimal ZERO = 
+  private static final BigDecimal ZERO = 
     new BigDecimal (BigInteger.valueOf (0), 0);
 
-  private final static BigDecimal ONE = 
+  private static final BigDecimal ONE = 
     new BigDecimal (BigInteger.valueOf (1), 0);
 
-  public final static int ROUND_UP = 0;
-  public final static int ROUND_DOWN = 1;
-  public final static int ROUND_CEILING = 2;
-  public final static int ROUND_FLOOR = 3;
-  public final static int ROUND_HALF_UP = 4;
-  public final static int ROUND_HALF_DOWN = 5;
-  public final static int ROUND_HALF_EVEN = 6;
-  public final static int ROUND_UNNECESSARY = 7;
+  public static final int ROUND_UP = 0;
+  public static final int ROUND_DOWN = 1;
+  public static final int ROUND_CEILING = 2;
+  public static final int ROUND_FLOOR = 3;
+  public static final int ROUND_HALF_UP = 4;
+  public static final int ROUND_HALF_DOWN = 5;
+  public static final int ROUND_HALF_EVEN = 6;
+  public static final int ROUND_UNNECESSARY = 7;
 
   public BigDecimal (BigInteger num) 
   {
Index: kaffe/libraries/javalib/java/math/BigInteger.java
diff -u kaffe/libraries/javalib/java/math/BigInteger.java:1.28 kaffe/libraries/javalib/java/math/BigInteger.java:1.29
--- kaffe/libraries/javalib/java/math/BigInteger.java:1.28	Sun Jul 18 15:28:11 2004
+++ kaffe/libraries/javalib/java/math/BigInteger.java	Thu Oct 14 20:24:05 2004
@@ -35,18 +35,15 @@
 obligated to do so.  If you do not wish to do so, delete this
 exception statement from your version. */
 
+
 package java.math;
 
 import gnu.java.math.MPN;
-import java.util.Random;
+
+import java.io.IOException;
 import java.io.ObjectInputStream;
 import java.io.ObjectOutputStream;
-import java.io.IOException;
-
-/**
- * @author Warren Levy <warrenl at cygnus.com>
- * @date December 20, 1999.
- */
+import java.util.Random;
 
 /**
  * Written using on-line Java Platform 1.2 API Specification, as well
@@ -56,17 +53,18 @@
  * Based primarily on IntNum.java BitOps.java by Per Bothner <per at bothner.com>
  * (found in Kawa 1.6.62).
  *
- * Status:  Believed complete and correct.
+ * @author Warren Levy <warrenl at cygnus.com>
+ * @date December 20, 1999.
+ * @status believed complete and correct.
  */
-
 public class BigInteger extends Number implements Comparable
 {
   /** All integers are stored in 2's-complement form.
    * If words == null, the ival is the value of this BigInteger.
    * Otherwise, the first ival elements of words make the value
    * of this BigInteger, stored in little-endian order, 2's-complement form. */
-  transient private int ival;
-  transient private int[] words;
+  private transient int ival;
+  private transient int[] words;
 
   // Serialization fields.
   private int bitCount = -1;
@@ -338,7 +336,7 @@
       }
   }
 
-  private final boolean isNegative()
+  private boolean isNegative()
   {
     return (words == null ? ival : words[ival - 1]) < 0;
   }
@@ -389,12 +387,12 @@
     return compareTo(this, val) > 0 ? this : val;
   }
 
-  private final boolean isZero()
+  private boolean isZero()
   {
     return words == null && ival == 0;
   }
 
-  private final boolean isOne()
+  private boolean isOne()
   {
     return words == null && ival == 1;
   }
@@ -440,7 +438,7 @@
   }
 
   /** Add two ints, yielding a BigInteger. */
-  private static final BigInteger add(int x, int y)
+  private static BigInteger add(int x, int y)
   {
     return valueOf((long) x + (long) y);
   }
@@ -480,13 +478,13 @@
   }
 
   /** Destructively add an int to this. */
-  private final void setAdd(int y)
+  private void setAdd(int y)
   {
     setAdd(this, y);
   }
 
   /** Destructively set the value of this to a long. */
-  private final void set(long y)
+  private void set(long y)
   {
     int i = (int) y;
     if ((long) i == y)
@@ -505,14 +503,14 @@
 
   /** Destructively set the value of this to the given words.
   * The words array is reused, not copied. */
-  private final void set(int[] words, int length)
+  private void set(int[] words, int length)
   {
     this.ival = length;
     this.words = words;
   }
 
   /** Destructively set the value of this to that of y. */
-  private final void set(BigInteger y)
+  private void set(BigInteger y)
   {
     if (y.words == null)
       set(y.ival);
@@ -572,7 +570,7 @@
     return add(this, val, -1);
   }
 
-  private static final BigInteger times(BigInteger x, int y)
+  private static BigInteger times(BigInteger x, int y)
   {
     if (y == 0)
       return ZERO;
@@ -604,7 +602,7 @@
     return result.canonicalize();
   }
 
-  private static final BigInteger times(BigInteger x, BigInteger y)
+  private static BigInteger times(BigInteger x, BigInteger y)
   {
     if (y.words == null)
       return times(x, y.ival);
@@ -1016,7 +1014,7 @@
     return BigInteger.make(rwords, rlen);
   }
 
-  private static final int[] euclidInv(int a, int b, int prevDiv)
+  private static int[] euclidInv(int a, int b, int prevDiv)
   {
     if (b == 0)
       throw new ArithmeticException("not invertible");
@@ -1033,8 +1031,8 @@
     return xy;
   }
 
-  private static final void euclidInv(BigInteger a, BigInteger b,
-                                      BigInteger prevDiv, BigInteger[] xy)
+  private static void euclidInv(BigInteger a, BigInteger b,
+                                BigInteger prevDiv, BigInteger[] xy)
   {
     if (b.isZero())
       throw new ArithmeticException("not invertible");
@@ -1184,7 +1182,7 @@
   }
 
   /** Calculate Greatest Common Divisor for non-negative ints. */
-  private static final int gcd(int a, int b)
+  private static int gcd(int a, int b)
   {
     // Euclid's algorithm, copied from libg++.
     int tmp;
@@ -1786,7 +1784,7 @@
   }
 
   /** Destructively negate this. */
-  private final void setNegative()
+  private void setNegative()
   {
     setNegative(this);
   }




More information about the kaffe mailing list