TorchLean API

NN.Floats.NeuralFloat.Rounding.Away

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.

noncomputable def TorchLean.Floats.neuralAwayRound (x : ) :

Integer rounding away from zero.

Instances For

    Away-from-zero agrees with floor on negative inputs.

    Away-from-zero agrees with ceiling on nonnegative inputs.

    On nonpositive inputs, away-from-zero agrees with floor, including at zero.

    Away-from-zero rounding is monotone and fixes integers.

    Arbitrary valid integer rounding chooses toward-zero or away-from-zero.

    Away-from-zero uses upward rounding for nonnegative values and downward rounding otherwise.

    Instances For

      Generic away-from-zero rounding satisfies its semantic point specification.