Java Utililty Methods Number Round

List of utility methods to do Number Round

Description

The list of methods to do Number Round are organized into topic(s).

Method

introundUp(int n, int nearestMultiple)
Round up the given value to given nearest multiple.
return n + nearestMultiple - 1 - (n - 1) % nearestMultiple;
introundUp(int ndigits)
round Up
return (ndigits + MAX_DIGITS - 1) / MAX_DIGITS;
introundUp(int num, int divisor)
round Up
return (num + divisor - 1) / divisor;
introundUp(int number, int interval)
Rounds the first parameter up to the next interval of the second parameter.
if (interval == 0) {
    return 0;
} else if (number == 0) {
    return interval;
} else {
    if (number < 0) {
        interval *= -1;
    int i = number % interval;
    return i == 0 ? number : number + interval - i;
introundUp(int p_154354_0_, int p_154354_1_)
round Up
if (p_154354_1_ == 0) {
    return 0;
} else if (p_154354_0_ == 0) {
    return p_154354_1_;
} else {
    if (p_154354_0_ < 0) {
        p_154354_1_ *= -1;
    int i = p_154354_0_ % p_154354_1_;
    return i == 0 ? p_154354_0_ : p_154354_0_ + p_154354_1_ - i;
introundUp(int v, int quant)
round Up
if ((v % quant) == 0) {
    return v;
} else {
    return ((v / quant) + 1) * quant;
introundUp(int val, int shift)
Rounds an integer up to the nearest multiple of 2^shift .
return (val + (1 << shift) - 1) >>> shift << shift;
introundUp(int val, int to)
Round the value up to the closest value of to.
return (val + 4) / to * to;
introundUp(int x, int blockSizePowerOf2)
Round the value up to the next block size.
return (x + blockSizePowerOf2 - 1) & (-blockSizePowerOf2);
introundUp(long n, long m)
Round n up to nearest multiple of m.
return (int) (((n + m - 1) / m) * m);