| Modifier and Type | Method and Description |
|---|---|
static int |
avg(int... ints)
Return the integer casted average of all the
ints. |
static int |
nextPowerOfTwo(int n)
Given an integer
n, round it up to the next power of 2. |
public static int nextPowerOfTwo(int n)
n, round it up to the next power of 2.
Props for this technique goes to Sean Eron Anderson courtesy of https://graphics.stanford.edu/~seander/bithacks.html
n - n.public static int avg(int... ints)
ints.ints -