List of utility methods to do Rounding Mode
RoundingMode | getOppositeRoundingMode(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: ... |
RoundingMode | normalizeRoundingMode(String roundingMode) Returns the given rounding mode if specified, or the default rounding mode. return roundingMode == null ? DEFAULT_ROUNDING_MODE : RoundingMode.valueOf(roundingMode);
|
double | roundHalfUp(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));
|
int | sqrt(int x, RoundingMode mode) sqrt return IntMath.sqrt(x, mode);
|