Value-preserving Posit decimal conversion #
The decimal string denotes exactly the decoded dyadic rational. Rounding that rational recovers the original posit word. This proves the decimal preservation guarantee of Posit Standard (2022), §6.3 for every descriptor width.
theorem
FloatLib.Floats.Formats.Posit.Model.decimalParse_display
{format : Format}
(value : Model format)
(exact : Numerics.Dyadic)
(hexact : value.toDyadic? = some exact)
:
An ordinary finite word's decimal display has exactly its decoded rational value.