diff options
author | Tom Tromey <tromey@redhat.com> | 2007-08-28 18:37:55 +0000 |
---|---|---|
committer | Tom Tromey <tromey@redhat.com> | 2007-08-28 18:37:55 +0000 |
commit | 75a73355f36e0cbbbab74aafaa63c8ae0cd80acf (patch) | |
tree | 290bff6ae0e24dff369e94c86b7b3f7136c6e723 /java/math | |
parent | 2320bcd1e6c566433eb0881aedce2f3aceb8cbdd (diff) | |
download | classpath-75a73355f36e0cbbbab74aafaa63c8ae0cd80acf.tar.gz |
2007-08-28 John X <johnx@dodgit.com>
PR classpath/33206:
* java/math/BigInteger.java (isProbablePrime): Handle case of
large 'b'.
Diffstat (limited to 'java/math')
-rw-r--r-- | java/math/BigInteger.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/java/math/BigInteger.java b/java/math/BigInteger.java index 8d174d084..3fb75ffa3 100644 --- a/java/math/BigInteger.java +++ b/java/math/BigInteger.java @@ -1,5 +1,5 @@ /* java.math.BigInteger -- Arbitary precision integers - Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2005, 2006 Free Software Foundation, Inc. + Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2005, 2006, 2007 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -1313,7 +1313,7 @@ public class BigInteger extends Number implements Comparable<BigInteger> int b = pMinus1.getLowestSetBit(); // Set m such that this = 1 + 2^b * m. - BigInteger m = pMinus1.divide(valueOf(2L << b - 1)); + BigInteger m = pMinus1.divide(valueOf(2L).pow(b)); // The HAC (Handbook of Applied Cryptography), Alfred Menezes & al. Note // 4.49 (controlling the error probability) gives the number of trials |