toNearestHalf method

Rational toNearestHalf([
  1. RoundingMode mode = RoundingMode.halfUp
])

Rounds the rational number to the nearest half

Parameters:

Returns: The rational number rounded to the nearest half

Implementation

Rational toNearestHalf([RoundingMode mode = RoundingMode.halfUp]) {
  return toNearest(RationalConstants.half, mode: mode);
}