|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object uk.ac.leeds.ccg.andyt.generic.math.Generic_Number uk.ac.leeds.ccg.andyt.generic.math.Generic_BigInteger
public class Generic_BigInteger
Field Summary | |
---|---|
java.util.TreeMap<java.lang.Integer,java.math.BigInteger> |
_Factorial_TreeMap
|
java.util.TreeMap<java.lang.Integer,java.math.BigInteger> |
_PowersOfTwo_TreeMap
|
static java.math.BigInteger |
Hundred
|
static java.math.BigInteger |
Integer_MAX_VALUE
|
static java.math.BigInteger |
Integer_MIN_VALUE
|
static java.math.BigInteger |
Long_MAX_VALUE
|
static java.math.BigInteger |
Long_MIN_VALUE
|
static java.math.BigInteger |
Three
|
static java.math.BigInteger |
Two
|
Fields inherited from class uk.ac.leeds.ccg.andyt.generic.math.Generic_Number |
---|
_RandomArray |
Constructor Summary | |
---|---|
Generic_BigInteger()
Creates a new instance of Generic_BigDecimal |
|
Generic_BigInteger(Generic_BigInteger _Generic_BigInteger)
Creates a new instance of Generic_BigDecimal |
Method Summary | |
---|---|
protected java.math.BigInteger |
addPowerOfTwo()
Adds and returns a power of 2 to _PowersOfTwo_TreeMap |
static java.math.BigInteger |
ceiling(java.math.BigDecimal x)
|
protected static java.math.BigDecimal |
exp(java.math.BigInteger y,
Generic_BigDecimal a_Generic_BigDecimal,
int decimalPlaces,
java.math.RoundingMode a_RoundingMode)
e^y = 1 + y/1! + y^2/2! + y^3/3! +... |
java.math.BigInteger |
factorial(java.lang.Integer x)
Adds values to _Factorial_TreeMap if they do not already exist. |
static java.math.BigInteger |
floor(java.math.BigDecimal x)
|
java.util.TreeMap<java.lang.Integer,java.math.BigInteger> |
get_PowersOfTwo_TreeMap()
|
java.util.TreeMap<java.lang.Integer,java.math.BigInteger> |
getPowersOfTwo(java.math.BigInteger x)
|
java.util.TreeMap<java.lang.Integer,java.lang.Integer> |
getPowersOfTwoDecomposition(java.math.BigInteger x)
The result provides the binary encoding for x |
java.math.BigInteger |
getRandom(java.math.BigInteger upperLimit)
There are methods to get large random numbers. |
java.math.BigInteger |
getRandom(java.util.Random a_Random,
java.math.BigInteger upperLimit)
|
protected void |
init_Factorial_TreeMap()
Initialises _Factorial_TreeMap |
protected void |
init_PowersOfTwo_TreeMap()
Initialises _Factorial_TreeMap |
static boolean |
isEven(java.math.BigInteger x)
Implementation tests the remainder when divided by 2. |
static void |
main(java.lang.String[] args)
|
static java.math.BigInteger |
max(java.math.BigInteger x,
java.math.BigInteger y)
|
static java.math.BigInteger |
min(java.math.BigInteger x,
java.math.BigInteger y)
|
static java.math.BigDecimal |
power(java.math.BigInteger x,
int y,
int decimalPlaces,
java.math.RoundingMode a_RoundingMode)
|
static java.math.BigDecimal |
power(java.math.BigInteger x,
long y,
int decimalPlaces,
java.math.RoundingMode a_RoundingMode)
|
java.math.BigInteger |
powerOfTwo(java.lang.Integer x)
Adds values to _PowersOfTwo_TreeMap if they do not already exist. |
static java.math.BigDecimal |
reciprocal(java.math.BigInteger x,
int decimalPlaces,
java.math.RoundingMode a_RoundingMode)
|
Methods inherited from class uk.ac.leeds.ccg.andyt.generic.math.Generic_Number |
---|
get_RandomArray, get_RandomArray, get_RandomArrayMinLength, init_RandomArrayMinLength, timeReport |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.math.BigInteger Two
public static final java.math.BigInteger Three
public static final java.math.BigInteger Hundred
public static final java.math.BigInteger Integer_MIN_VALUE
public static final java.math.BigInteger Integer_MAX_VALUE
public static final java.math.BigInteger Long_MIN_VALUE
public static final java.math.BigInteger Long_MAX_VALUE
public transient java.util.TreeMap<java.lang.Integer,java.math.BigInteger> _Factorial_TreeMap
public transient java.util.TreeMap<java.lang.Integer,java.math.BigInteger> _PowersOfTwo_TreeMap
Constructor Detail |
---|
public Generic_BigInteger()
public Generic_BigInteger(Generic_BigInteger _Generic_BigInteger)
Method Detail |
---|
public static void main(java.lang.String[] args)
args
- the command line argumentsprotected void init_Factorial_TreeMap()
protected void init_PowersOfTwo_TreeMap()
public static java.math.BigInteger ceiling(java.math.BigDecimal x)
x
-
public static java.math.BigInteger floor(java.math.BigDecimal x)
x
-
public static java.math.BigInteger max(java.math.BigInteger x, java.math.BigInteger y)
x
- y
-
public static java.math.BigInteger min(java.math.BigInteger x, java.math.BigInteger y)
x
- y
-
public java.math.BigInteger factorial(java.lang.Integer x)
x
-
public java.math.BigInteger powerOfTwo(java.lang.Integer x)
x
-
protected java.math.BigInteger addPowerOfTwo()
public java.util.TreeMap<java.lang.Integer,java.math.BigInteger> get_PowersOfTwo_TreeMap()
public java.util.TreeMap<java.lang.Integer,java.math.BigInteger> getPowersOfTwo(java.math.BigInteger x)
x
-
public java.util.TreeMap<java.lang.Integer,java.lang.Integer> getPowersOfTwoDecomposition(java.math.BigInteger x)
x
-
public static java.math.BigDecimal power(java.math.BigInteger x, int y, int decimalPlaces, java.math.RoundingMode a_RoundingMode)
x
- y
-
public static java.math.BigDecimal power(java.math.BigInteger x, long y, int decimalPlaces, java.math.RoundingMode a_RoundingMode)
x
- y
-
public static java.math.BigDecimal reciprocal(java.math.BigInteger x, int decimalPlaces, java.math.RoundingMode a_RoundingMode)
x
- decimalPlaces
- a_RoundingMode
-
protected static java.math.BigDecimal exp(java.math.BigInteger y, Generic_BigDecimal a_Generic_BigDecimal, int decimalPlaces, java.math.RoundingMode a_RoundingMode)
y
- decimalPlaces
-
public java.math.BigInteger getRandom(java.math.BigInteger upperLimit)
a_Random
- upperLimit
-
public java.math.BigInteger getRandom(java.util.Random a_Random, java.math.BigInteger upperLimit)
public static boolean isEven(java.math.BigInteger x)
x
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |