Ordinary posit values as exact rationals #
The NaR encoding has no rational denotation. Excluding it gives a subtype on which exact rational decoding is total.
No alternate encoding is introduced: Model.Ordinary format is a proof-carrying view of the same
encoded word. The full posit order still belongs to Model format; the rational coordinate here
is available for every value of the subtype.
@[reducible, inline]
A posit word accompanied by proof that it is not the unique NaR encoding.
Instances For
@[inline]
def
FloatLib.Floats.Formats.Posit.Model.Ordinary.toRat
{format : Format}
(value : Ordinary format)
:
Total exact rational semantics of an ordinary posit.
The proof argument to Option.get is erased at runtime. It records that the only absent rational
meaning belongs to NaR, which the subtype excludes.
Instances For
Ordinary zero, retaining proof that the zero word is not NaR.