TorchLean API

FloatLib.Numerics.Exact.DecimalText.Precision

Requested precision for external decimal text #

The digit grid and decade carry depend only on an exact decimal value. A caller supplies the signed magnitude-to-integer rounding function; this module makes no choice of source format, exponent bounds, cohort policy, or exception handling. It applies equally to decimal datums and terminating decimal expansions of dyadics.

Requested precision has no width cap. Zero uses adjusted exponent zero, hence quantum 1-p at precision p. Sign preservation includes signed zero.

Exact representation and a requested significant-digit count are distinct output modes.

Instances For
    def FloatLib.Numerics.DecimalText.significantQuantum (coefficient : ) (quantum : ) (digits : ℕ+) :

    Decimal position of the last requested digit.

    Instances For
      def FloatLib.Numerics.DecimalText.roundDecimal (roundMagnitude : Bool) (value : Decimal) (quantum : ) :

      Round on a decimal grid with the caller's magnitude-to-integer rounding function.

      Instances For

        Carry into a new decade without adding an extra significant digit.

        Instances For
          def FloatLib.Numerics.DecimalText.significantDecimal (roundMagnitude : Bool) (value : Decimal) (digits : ℕ+) :

          One rounding at the requested significant-digit grid, followed by a value-preserving carry.

          Instances For