Nearest Rounding with a Tie Choice #
nearestChoice chooseUp rounds to a nearest integer. At an exact midpoint, chooseUp f
decides whether the lower integer f or the upper integer f + 1 is selected. This is the native
Lean counterpart of Flocq's Znearest choice. nearestAwayChoice is the tie rule of IEEE
754-2019 roundTiesToAway.
Choice-based nearest rounding always selects floor or ceiling.
Choice-based nearest rounding lies between floor and floor plus one.
Choice-based nearest rounding fixes integers.
Every tie choice has absolute error at most one half.
Choice-based nearest rounding is monotone.
Every tie-choice nearest mode is a valid nearest rounding mode.
Tie choice of rounding to nearest with ties away from zero.
A midpoint f + 1/2 above a nonnegative integer f is positive and goes up to f + 1. A
midpoint above a negative integer is negative and stays at f. Either way the tie goes to the
neighbor of larger magnitude.