MPN.java (findLowestBit): Made methods public.

* gnu/gcj/math/MPN.java(findLowestBit): Made methods public.

	* java/math/BigInteger.java(BigInteger(int,int,java.util.Random):
	  New constructor.
	(min): Implemented.
	(max): Implemented.
	(modPow): Rewritten to not use the naive, slow, brute force approach.
	(isProbablePrime): Implemented.
	(testBit): Implemented.
	(flipBit): Implemented.
	(getLowestSetBit): Implemented.

From-SVN: r31966
This commit is contained in:
Warren Levy 2000-02-14 10:23:29 +00:00 committed by Warren Levy
parent eb3e566556
commit 34540fe35e
3 changed files with 171 additions and 23 deletions

View file

@ -571,7 +571,7 @@ public class MPN
/** Return least i such that word&(1<<i). Assumes word!=0. */
static int findLowestBit (int word)
public static int findLowestBit (int word)
{
int i = 0;
while ((word & 0xF) == 0)
@ -591,7 +591,7 @@ public class MPN
/** Return least i such that words & (1<<i). Assumes there is such an i. */
static int findLowestBit (int[] words)
public static int findLowestBit (int[] words)
{
for (int i = 0; ; i++)
{