lima.mathematical.utilities
Class BigIntegerFunctions

java.lang.Object
  |
  +--lima.mathematical.utilities.BigIntegerFunctions

public class BigIntegerFunctions
extends java.lang.Object

A class to provide extra functions performed on BigInteger's

See Also:
BigInteger

Field Summary
static java.math.BigInteger EIGHT
           
static java.math.BigInteger FIVE
           
static java.math.BigInteger FOUR
           
static java.math.BigInteger ONE
           
static int PRIME_CERTAINTY
          The degree of certainty that this big integer is actually prime.
static java.math.BigInteger SEVEN
           
static java.math.BigInteger SIX
           
static java.math.BigInteger SIXTEEN
           
static java.math.BigInteger THREE
           
static java.math.BigInteger TWO
           
static java.math.BigInteger ZERO
           
 
Constructor Summary
BigIntegerFunctions()
           
 
Method Summary
static int doJacobi(int sign, java.math.BigInteger m, java.math.BigInteger n)
           
static boolean isPrime(java.math.BigInteger n)
          Determine whether (or not) the specified * BigInteger is prime, with high certainty.
static int jacobiSymbol(java.math.BigInteger n, java.math.BigInteger p)
           
static long legendreSymbol(java.math.BigInteger n, java.math.BigInteger p)
          Calculate the Legendre symbol (n/p)
static double log(java.math.BigInteger z)
          Calculate the logarithm of a BigInteger.
static java.math.BigInteger sqrt(java.math.BigInteger i)
          Calculate square root of a BigInteger, rounding down
static java.math.BigInteger sqrtMod(java.math.BigInteger a, java.math.BigInteger q)
          Calculate the sqaure root of a BigInteger with respect to a certain modulo
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ZERO

public static final java.math.BigInteger ZERO

ONE

public static final java.math.BigInteger ONE

TWO

public static final java.math.BigInteger TWO

THREE

public static final java.math.BigInteger THREE

FOUR

public static final java.math.BigInteger FOUR

FIVE

public static final java.math.BigInteger FIVE

SIX

public static final java.math.BigInteger SIX

SEVEN

public static final java.math.BigInteger SEVEN

EIGHT

public static final java.math.BigInteger EIGHT

SIXTEEN

public static final java.math.BigInteger SIXTEEN

PRIME_CERTAINTY

public static final int PRIME_CERTAINTY
The degree of certainty that this big integer is actually prime.

See Also:
Constant Field Values
Constructor Detail

BigIntegerFunctions

public BigIntegerFunctions()
Method Detail

isPrime

public static boolean isPrime(java.math.BigInteger n)
Determine whether (or not) the specified * BigInteger is prime, with high certainty.


legendreSymbol

public static long legendreSymbol(java.math.BigInteger n,
                                  java.math.BigInteger p)
Calculate the Legendre symbol (n/p)


jacobiSymbol

public static int jacobiSymbol(java.math.BigInteger n,
                               java.math.BigInteger p)

doJacobi

public static int doJacobi(int sign,
                           java.math.BigInteger m,
                           java.math.BigInteger n)

sqrt

public static java.math.BigInteger sqrt(java.math.BigInteger i)
Calculate square root of a BigInteger, rounding down


log

public static double log(java.math.BigInteger z)
Calculate the logarithm of a BigInteger.


sqrtMod

public static java.math.BigInteger sqrtMod(java.math.BigInteger a,
                                           java.math.BigInteger q)
                                    throws java.lang.Exception
Calculate the sqaure root of a BigInteger with respect to a certain modulo

Parameters:
a - - the big integer to be square rooted
q - - the modulo which this is to be done in respect of
java.lang.Exception