List of utility methods to do Ceil
int | ceilingPow2(int n) Converting the passed value to make sure we can use it for OpenGL. int pow2 = 1; while (n > pow2) pow2 = pow2 << 1; return pow2; |
int | ceilingPowerOf2(final int n) Computes the ceiling power of 2 within the range [1, 2^30]. if (n <= 1) { return 1; final int topPwrOf2 = 1 << 30; return (n >= topPwrOf2) ? topPwrOf2 : Integer.highestOneBit((n - 1) << 1); |
int | ceilingPowerOf2(int n) Computes the ceiling power of 2 within the range [1, 2^30]. if (n <= 1) { return 1; if (n >= IntTopPwrOf2) { return IntTopPwrOf2; n--; for (int i = 1; i <= MaxIntShifts; i <<= 1) { ... |
int | ceilingPowerOfTwo(final int a) ceiling Power Of Two checkIsInRange(0, 1 << 30, a);
return a >= 2 ? Integer.highestOneBit(a - 1 << 1) : 1;
|
int | ceilingPowerOfTwo(int value) Returns the smallest power of two number that is greater than or equal to value . return 1 << -Integer.numberOfLeadingZeros(value - 1);
|
Double | ceilInt(Double d, double intv) ceil Int return floorInt(d, intv) + intv;
|
int | ceilInt(final double x) Returns (int) Math.ceil(x) .
return (int) Math.ceil(x); |
int | ceilLogBaseTwo(final int i) Returns the log base 2 of an integer, rounded to the ceiling. checkPositiveInteger(i);
return 32 - Integer.numberOfLeadingZeros(i - 1);
|
int | ceilMaskPOT(int n) ceil Mask POT n |= n >>> 1;
n |= n >>> 2;
n |= n >>> 4;
n |= n >>> 8;
n |= n >>> 16;
return n;
|
float | ceilMultiple(float source, float multiple) ceil Multiple if (source > 0) { float tmp = source - 1; return tmp + (multiple - (tmp % multiple)); } else { return source + (-source % multiple); |