Decimal character conversion for BID and DPD words #
The encoding and width select only the source/destination codec. Parsing, precision rounding, and status handling use the shared datum operations. Exact output followed by input recovers the canonical word: redundant encodings are not character-level representation information.
An encoded decimal result and the five conversion flags.
The result encoded in the selected BID or DPD layout.
- status : Status
IEEE exception indicators raised by character conversion.
Instances For
def
FloatLib.Floats.Formats.DecimalInterchange.Formatting.instDecidableEqWordOutcome.decEq
{f✝ : Format}
(x✝ x✝¹ : WordOutcome f✝)
:
Instances For
@[instance_reducible]
@[instance_reducible]
instance
FloatLib.Floats.Formats.DecimalInterchange.Formatting.instReprWordOutcome
{f✝ : Format}
:
Repr (WordOutcome f✝)
def
FloatLib.Floats.Formats.DecimalInterchange.Formatting.instReprWordOutcome.repr
{f✝ : Format}
:
WordOutcome f✝ → ℕ → Std.Format
Instances For
def
FloatLib.Floats.Formats.DecimalInterchange.Formatting.parseWord
(encoding : Encoding)
(f : Format)
(mode : RoundingMode)
(text : String)
:
Parse and round once, then encode the valid result as BID or DPD.
Instances For
def
FloatLib.Floats.Formats.DecimalInterchange.Formatting.formatWord
(encoding : Encoding)
(f : Format)
(mode : RoundingMode)
(precision : Precision)
(word : BitVec f.bitWidth)
:
Decode a word and apply the requested decimal output precision.
Instances For
theorem
FloatLib.Floats.Formats.DecimalInterchange.Formatting.decode_parseWord
(encoding : Encoding)
(f : Format)
(mode : RoundingMode)
(text : String)
:
The word parser encodes precisely the datum parser's result, including special fields.
theorem
FloatLib.Floats.Formats.DecimalInterchange.Formatting.parseWord_formatWord_exact
(encoding : Encoding)
(f : Format)
(outputMode inputMode : RoundingMode)
(word : BitVec f.bitWidth)
:
parseWord encoding f inputMode (formatWord encoding f outputMode Numerics.DecimalText.Precision.exact word).text = { word := encoding.canonicalize f word }
Exact text roundtrips every word to its canonical representative, in any pair of modes.