TorchLean API

FloatLib.Numerics.Exact.RadixText.Precision

Significant-digit rounding on an arbitrary radix grid #

Decimal and hexadecimal output share the grid calculation, one integer rounding, and carry. The radix and rounding callback are explicit; there are no format widths or exponent limits here. Meaningful radix semantics require 1 < radix.

def FloatLib.Numerics.RadixText.significantQuantum (radix coefficient : ) (quantum : ) (digits : ℕ+) :

Exponent of the last requested radix digit, with adjusted exponent zero for zero.

Instances For
    def FloatLib.Numerics.RadixText.roundCoefficient (radix : ) (roundMagnitude : Bool) (negative : Bool) (coefficient : ) (quantum destination : ) :

    Round a coefficient onto another grid using an exact magnitude-rounding callback.

    Instances For
      def FloatLib.Numerics.RadixText.carry (radix : ) (digits : ℕ+) (coefficient : ) (quantum : ) :

      Carry a rounded coefficient into the next radix position without changing its value.

      Instances For
        def FloatLib.Numerics.RadixText.significant (radix : ) (roundMagnitude : Bool) (negative : Bool) (coefficient : ) (quantum : ) (digits : ℕ+) :

        One significant-digit rounding, followed by a value-preserving radix carry.

        Instances For