RoundingMode

Specifies a rounding behavior for discarding precision of Floats. A rounding mode dictates how the least significant returned digit of a rounded result is calculated.

Ceiling

Rounding mode to round towards positive infinity.

Down

Rounding mode to round towards zero.

Floor

Rounding mode to round towards negative infinity.

HalfDown

Rounding mode to round towards “nearest neighbor” unless both neighbors are equidistant, in which case round towards zero.

HalfEven

Rounding mode to round towards the “nearest neighbor” unless both neighbors are equidistant, in which case, round towards the even neighbor.

HalfUp

Rounding mode to round towards “nearest neighbor” unless both neighbors are equidistant, in which case round away from zero.

Up

Rounding mode to round away from zero.

The rounding modes correspond to the ones found in java.math.RoundingMode (https://docs.oracle.com/javase/8/docs/api/java/math/RoundingMode.html).

type RoundingMode
  | Ceiling
  | Down
  | Floor
  | HalfDown
  | HalfEven
  | HalfUp
  | Up

Used in Math::round