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:
parent
eb3e566556
commit
34540fe35e
3 changed files with 171 additions and 23 deletions
|
@ -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++)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue