java.lang.Object
org.jgrapht.util.MathUtil
Math Utilities.
- Author:
- Assaf Lehr
-
Constructor Summary
-
Method Summary
-
Constructor Details
-
MathUtil
public MathUtil()
-
-
Method Details
-
factorial
public static long factorial(int n) Calculate the factorial of $n$.- Parameters:
n
- the input number- Returns:
- the factorial
-
log2
public static int log2(int n) Calculate the floor of the binary logarithm of $n$.- Parameters:
n
- the input number- Returns:
- the binary logarithm
-