C# Class CSJ2K.j2k.util.MathUtil

This class contains a collection of utility methods fro mathematical operations. All methods are static.
Afficher le fichier Open project: cureos/csj2k

Méthodes publiques

Méthode Description
gcd ( int x ) : int

Method that calculates the Greatest Common Divisor (GCD) of several positive integer numbers.

gcd ( int x1, int x2 ) : int

Method that calculates the Greatest Common Divisor (GCD) of two positive integer numbers.

lcm ( int x ) : int

Method that calculates the Least Common Multiple (LCM) of several positive integer numbers.

lcm ( int x1, int x2 ) : int

Method that calculates the Least Common Multiple (LCM) of two strictly positive integer numbers.

log2 ( int x ) : int

Method that calculates the floor of the log, base 2, of 'x'. The calculation is performed in integer arithmetic, therefore, it is exact.

Method Details

gcd() public static méthode

Method that calculates the Greatest Common Divisor (GCD) of several positive integer numbers.
public static gcd ( int x ) : int
x int Array containing the numbers. /// ///
Résultat int

gcd() public static méthode

Method that calculates the Greatest Common Divisor (GCD) of two positive integer numbers.
public static gcd ( int x1, int x2 ) : int
x1 int
x2 int
Résultat int

lcm() public static méthode

Method that calculates the Least Common Multiple (LCM) of several positive integer numbers.
public static lcm ( int x ) : int
x int Array containing the numbers. /// ///
Résultat int

lcm() public static méthode

Method that calculates the Least Common Multiple (LCM) of two strictly positive integer numbers.
public static lcm ( int x1, int x2 ) : int
x1 int First number /// ///
x2 int Second number /// ///
Résultat int

log2() public static méthode

Method that calculates the floor of the log, base 2, of 'x'. The calculation is performed in integer arithmetic, therefore, it is exact.
public static log2 ( int x ) : int
x int The value to calculate log2 on. /// ///
Résultat int