| java.lang.Object jj2000.j2k.util.MathUtil
MathUtil | public class MathUtil (Code) | | This class contains a collection of utility methods fro mathematical
operations. All methods are static.
|
Method Summary | |
final public static int | gcd(int x1, int x2) Method that calculates the Greatest Common Divisor (GCD) of two
positive integer numbers. | final public static int | gcd(int[] x) Method that calculates the Greatest Common Divisor (GCD) of several
positive integer numbers. | final public static int | lcm(int x1, int x2) Method that calculates the Least Common Multiple (LCM) of two strictly
positive integer numbers. | final public static int | lcm(int[] x) Method that calculates the Least Common Multiple (LCM) of several
positive integer numbers. | public static int | log2(int x) Method that calculates the floor of the log, base 2,
of 'x'. |
gcd | final public static int gcd(int x1, int x2)(Code) | | Method that calculates the Greatest Common Divisor (GCD) of two
positive integer numbers.
|
gcd | final public static int gcd(int[] x)(Code) | | Method that calculates the Greatest Common Divisor (GCD) of several
positive integer numbers.
Parameters: x - Array containing the numbers. |
lcm | final public static int lcm(int x1, int x2)(Code) | | Method that calculates the Least Common Multiple (LCM) of two strictly
positive integer numbers.
Parameters: x1 - First number Parameters: x2 - Second number |
lcm | final public static int lcm(int[] x)(Code) | | Method that calculates the Least Common Multiple (LCM) of several
positive integer numbers.
Parameters: x - Array containing the numbers. |
log2 | public static int log2(int x)(Code) | | Method that calculates the floor of the log, base 2,
of 'x'. The calculation is performed in integer arithmetic,
therefore, it is exact.
Parameters: x - The value to calculate log2 on. floor(log(x)/log(2)), calculated in an exact way. |
|
|