This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
PATCH: java.math.BigInteger
- To: Java Patch List <java-patches at gcc dot gnu dot org>
- Subject: PATCH: java.math.BigInteger
- From: Warren Levy <warrenl at redhat dot com>
- Date: Tue, 19 Jun 2001 04:40:37 -0700 (PDT)
Folks,
Here's a patch from Mark J. Roberts that I've been long overdue in
checking in. It fixes a problem with the BigInteger code.
--warrenl
2001-06-19 Mark J. Roberts <mjr@statesmean.com>
* java/math/BigInteger.java (byteArrayToIntArray): Don't include
extraneous/malformed sign word.
Index: java/math/BigInteger.java
===================================================================
RCS file: /cvs/gcc/egcs/libjava/java/math/BigInteger.java,v
retrieving revision 1.11
diff -u -p -r1.11 BigInteger.java
--- BigInteger.java 2001/03/02 06:55:33 1.11
+++ BigInteger.java 2001/06/19 11:37:08
@@ -220,12 +220,8 @@ public class BigInteger extends Number i
private static int[] byteArrayToIntArray(byte[] bytes, int sign)
{
// Determine number of words needed.
- int[] words = new int[(bytes.length + 3) / 4 + 1];
+ int[] words = new int[bytes.length/4 + 1];
int nwords = words.length;
-
- // For simplicity, tack on an extra word of sign at the front,
- // it will be canonicalized out later. */
- words[--nwords] = sign;
// Create a int out of modulo 4 high order bytes.
int bptr = 0;