|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectch.javasoft.util.numeric.BigIntegerUtil
public class BigIntegerUtil
The BigIntegerUtil contains static utility methods concerning
big integers
| Method Summary | |
|---|---|
static BigInteger |
gcd(BigInteger... values)
Calculates the greatest common divisor of the specified big integer numbers. |
static BigInteger |
lcm(BigInteger... values)
Calculates the least common multiple of the specified big integer numbers. |
static BigInteger |
valueOf(Number number)
Optimized value-of method, should actually be part of BigInteger. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static BigInteger gcd(BigInteger... values)
big integer numbers.
This method might be useful to scale down a vector of big integers.
If all numbers are negative, the resulting gcd is also negative. If all numbers are zero, the result is zero. Otherwise, the result is positive.
values - values for which the gcd is to be computed
public static BigInteger lcm(BigInteger... values)
big integer numbers.
This method might be useful to scale up a vector of fractions to convert
them to integers.
The result is negative if an uneven number of single values is negative, one for no values or if all values are zero and positive otherwise.
values - values for which the lcm is to be computed
public static BigInteger valueOf(Number number)
BigInteger.
If the number is any kind of integer, BigInteger.valueOf(long)
is used. If number is fraction number, BigFraction.toBigInteger()
is used. Otherwise, the number is converted into a string and the
string constructor is used to
instantiate a big integer.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||