Rounding Away from Zero #
Away-from-zero rounding uses ceiling on nonnegative inputs and floor on negative inputs. Together with toward-zero rounding, it supplies the second endpoint decomposition for arbitrary valid integer rounding modes.
Integer rounding away from zero.
Instances For
Away-from-zero agrees with floor on negative inputs.
On nonpositive inputs, away-from-zero agrees with floor, including at zero.
Away-from-zero rounding is monotone and fixes integers.
theorem
FloatLib.Floats.Formats.Flocq.round_away_point
{β : Numerics.Radix}
{fexp : ℤ → ℤ}
[ValidExp fexp]
(x : ℝ)
:
RoundAwayFromZeroPoint (genericFormat β fexp) x (round awayRound x)
Generic away-from-zero rounding satisfies its semantic point specification.