TorchLean API

FloatLib.Floats.Formats.BinaryInterchange.Conversion.Text.Parsing

Binary external character conversion #

Decimal integers, fractions and e/E exponents use the shared exact scanner. Hexadecimal input follows IEEE 754 §5.12.3, including its mandatory p/P exponent. The older m * 2^e spelling remains accepted. ASCII edge whitespace is ignored. Finite conversion rounds once and reports the existing binary exception policy, including tininess after rounding. Syntax errors remain explicit ParseErrors.

Inf/Infinity/NaN/sNaN accept either case and an optional sign. A NaN's decimal suffix denotes its complete fraction field, including the quiet bit. Zero or an absent suffix chooses a default payload. Valid explicit payloads preserve sign and signaling state without invalid. A descriptor unable to encode a signaling NaN may quiet the default sNaN and raise invalid.

Why exact character input could not produce a value in the requested format.

  • emptyInput : ParseError

    The input contains no non-whitespace characters.

  • invalidSyntax (input : String) : ParseError

    The input is not a supported decimal, radix-two, infinity, or NaN spelling.

  • unsupportedInfinity (negative : Bool) : ParseError

    The input requests an infinity from a finite-only encoding.

  • unsupportedNaN : ParseError

    The input requests a NaN from an encoding with no NaN representation.

  • inputTooLong (actual maximum : ) : ParseError

    The input exceeds the caller's byte limit before character scanning.

  • exponentTooLarge (actual maximum : ) : ParseError

    The adjusted decimal or binary exponent exceeds the caller's magnitude limit.

Instances For

    Concise human-readable explanation of a character-input failure.

    Instances For

      Unrounded external text, retaining a decimal scale or binary scale and signed zero.

      Instances For

        Decode the legacy exact radix-two spelling, using the common integer scanner.

        Instances For

          Decode one complete trimmed string before choosing a destination format or rounding.

          Instances For

            One exact decimal-to-binary rounding, paired with the shared binary status calculation.

            Instances For

              One hexadecimal or legacy dyadic conversion with binary rounding status.

              Instances For

                Interpret a NaN diagnostic according to the descriptor, rejecting unrepresentable payloads.

                Instances For

                  Convert a decoded text value. Unsupported specials and invalid diagnostics are explicit errors.

                  Instances For

                    Implementation core for character input, reporting all five IEEE exceptions. Finite input is converted from its complete exact value without resource limits. The caller-facing entrypoint is Model.parse in BoundedParsing.

                    Instances For