Package com.viaversion.viaversion.util
Class MathUtil
java.lang.Object
com.viaversion.viaversion.util.MathUtil
-
Constructor Summary
-
Method Summary
-
Constructor Details
-
MathUtil
public MathUtil()
-
-
Method Details
-
ceilLog2
public static int ceilLog2(int i) Returns the ceiled log to the base of 2 for the given number.- Parameters:
i
- positive number to ceillog- Returns:
- ceiled log2 of the given number
-
clamp
public static int clamp(int i, int min, int max) Returns the clamped number within the given range.- Parameters:
i
- number to clampmin
- minimum valuemax
- maximum value- Returns:
- clamped number
-