Order Theory for Generic Rounding #
Monotonicity is subtle because two inputs may be scaled with different canonical exponents. The
proof separates equal-grid inputs from inputs in different magnitude bins and uses the bounds from
GenericRound in the latter case.
Rounding is monotone when both inputs use the same canonical exponent.
Positive generic rounding is monotone.
Rounding a nonnegative value with a valid mode produces a nonnegative value.
Rounding a nonpositive value with a valid mode produces a nonpositive value.
Generic rounding is monotone on all real inputs.
A representable lower value remains below rounding of any larger input.
Rounding of a smaller input remains below a representable upper value.
Directed-down generic rounding selects the greatest representable value below its input.
Directed-up generic rounding selects the least representable value above its input.
Generic truncation satisfies the toward-zero rounding specification.
Nearest-even generic rounding is no farther from the input than any other integer rounding.
Nearest-even rounding selects a globally nearest representable value.