List of utility methods to do Ceil
int | ceil(int f) ceil if ((f & 0xFFFF) == 0) return f; return (f & ~0xFFFF) + (f < 0 ? 0 : 65536); |
int | ceil(int number, int divisor) ceil assert divisor > 0; int result = number / divisor + ((number % divisor) > 0 ? 1 : 0); return result; |
int | ceil(int x, int quantum) Returns minimal possible integer, greater or equal than x , divisible by quantum .
int dx = (x < 0) || (x % quantum == 0) ? 0 : 1; return (x / quantum + dx) * quantum; |
long | ceil(long a, long b) ceil long r = a % b; if (r > 0) { return a - r + b; } else { return a - r; |
void | Ceil(Object in, int val) Ceil if (in == null) return; if (in instanceof int[]) { int[] inn = (int[]) in; for (int i = 0, s = inn.length; i < s; i++) if (inn[i] > val) inn[i] = val; } else { ... |
double | ceil(Short a) Ceil. return Math.ceil(a.doubleValue());
|
double | ceil10(double a) Returns the smallest (closest to negative infinity) double value that is a power of 10 not less than the argument. return Math.pow(10, Math.ceil(log10(a)));
|
double | ceil2(double d, int p) ceil long tmp = (long) Math.pow(10, p); double num = Math.ceil(d / tmp); num *= tmp; return num; |
int | ceil2(int a, int preserveDigits) Math#ceil(double) -like operation for integers preserving the given number of digits in contrary to MathUtil#ceil(int,int) where cut-of-digits are specified: return ceil(a, getDigits(a) - preserveDigits)
return ceil(a, getDigits(a) - preserveDigits);
|
int | ceilDiv(int numerator, int denominator) ceil Div return (int) Math.ceil((double) numerator / denominator); |