TorchLean API

FloatLib.Numerics.Exact.DecimalText.Notation

Fixed and scientific decimal presentation #

These renderers place the decimal point in the digits of an exact decimal record. They perform no rounding and retain coefficient trailing zeros. Scientific notation keeps one digit before the point and always prints an exponent, including for signed zero.

formatDyadicCompact is the exception: it first removes fractional trailing zeros, then prints fixed notation such as 1.5 or 6, falling back to the shorter e exponent form when fixed notation would need more characters. It is the text of a Dyadic. ofRat? gives the exact decimal record of a rational with a terminating expansion.

Join whole and fractional digits, omitting the point when there are no fractional digits.

Instances For

    Write coefficient with places digits after the point, padding with zeros on the left.

    Instances For

      The record recovered from fixed notation: positive powers of ten become integer digits.

      Instances For

        Fixed notation with the original sign and all fractional places specified by the exponent.

        Instances For

          Fixed decimal text, with no precision limit or additional rounding.

          Instances For

            Scientific notation with one leading digit and the original coefficient's trailing zeros. For zero with exponent -places, print places fractional zeros and exponent zero. Every output determines the original decimal record, including its sign and zero precision.

            Instances For

              Scientific decimal text, with no precision limit or additional rounding.

              Instances For

                Fuel-bounded worker that removes one trailing decimal zero per step while the exponent is negative.

                Instances For

                  Remove fractional trailing zeros from the significand without changing the exact value. Nonnegative exponents are left alone, so integers keep their digits.

                  Instances For

                    Fuel-bounded worker that moves one trailing decimal zero of a nonzero significand into the exponent per step.

                    Instances For

                      Move every trailing decimal zero of a nonzero significand into the exponent, so the significand has no trailing zeros. The value and sign are unchanged.

                      Instances For

                        Exact decimal text of a dyadic without redundant fractional zeros. Fixed notation such as 1.5 is used unless the e exponent form is shorter.

                        Instances For
                          @[instance_reducible]

                          Text of a dyadic: its exact value, as formatDyadicCompact writes it.

                          Remove factors p from n while it is divisible, counting them, with fuel.

                          Instances For

                            The exact decimal record of a rational whose denominator has no prime factor other than two and five. Every other rational has a nonterminating decimal expansion and gives none.

                            Instances For