toNearestHalf method
Rounds the rational number to the nearest half
Parameters:
mode: The rounding mode to apply. Defaults to RoundingMode.halfUp
Returns: The rational number rounded to the nearest half
Implementation
Rational toNearestHalf([RoundingMode mode = RoundingMode.halfUp]) {
return toNearest(RationalConstants.half, mode: mode);
}