|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--jj2000.j2k.util.MathUtil
This class contains a collection of utility methods fro mathematical operations. All methods are static.
Constructor Summary | |
MathUtil()
|
Method Summary | |
static int |
gcd(int[] x)
Method that calculates the Greatest Common Divisor (GCD) of several positive integer numbers. |
static int |
gcd(int x1,
int x2)
Method that calculates the Greatest Common Divisor (GCD) of two positive integer numbers. |
static int |
lcm(int[] x)
Method that calculates the Least Common Multiple (LCM) of several positive integer numbers. |
static int |
lcm(int x1,
int x2)
Method that calculates the Least Common Multiple (LCM) of two strictly positive integer numbers. |
static int |
log2(int x)
Method that calculates the floor of the log, base 2, of 'x'. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public MathUtil()
Method Detail |
public static int log2(int x)
x
- The value to calculate log2 on.
public static final int lcm(int x1, int x2)
x1
- First numberx2
- Second numberpublic static final int lcm(int[] x)
x
- Array containing the numbers.public static final int gcd(int x1, int x2)
public static final int gcd(int[] x)
x
- Array containing the numbers.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |