Java Utililty Methods Rounding Mode

List of utility methods to do Rounding Mode

Description

The list of methods to do Rounding Mode are organized into topic(s).

Method

RoundingModegetOppositeRoundingMode(RoundingMode roundingMode)
get Opposite Rounding Mode
switch (roundingMode) {
case UP:
    return RoundingMode.DOWN;
case DOWN:
    return RoundingMode.UP;
case CEILING:
    return RoundingMode.FLOOR;
case FLOOR:
...
RoundingModenormalizeRoundingMode(String roundingMode)
Returns the given rounding mode if specified, or the default rounding mode.
return roundingMode == null ? DEFAULT_ROUNDING_MODE : RoundingMode.valueOf(roundingMode);
doubleroundHalfUp(double value)
Returns the rounded double of the given value, rounding to the nearest integer value away from zero on ties.
return Math.signum(value) * Math.round(Math.abs(value));
intsqrt(int x, RoundingMode mode)
sqrt
return IntMath.sqrt(x, mode);