public final class MathUtil
extends java.lang.Object
Constructor and Description |
---|
MathUtil() |
Modifier and Type | Method and Description |
---|---|
static int |
ceilLog2(int i)
Returns the ceiled log to the base of 2 for the given number.
|
static int |
clamp(int i,
int min,
int max)
Returns the clamped number within the given range.
|
public static int ceilLog2(int i)
i
- positive number to ceillogpublic static int clamp(int i, int min, int max)
i
- number to clampmin
- minimum valuemax
- maximum value