Configured posit and decimal conversion #
The selected posit carrier is decoded or encoded through its lawful model codec. All numerical work is performed by the shared model conversion.
@[inline]
def
FloatLib.Floats.Formats.DecimalInterchange.Conversion.fromConfiguredPosit
{format : Posit.Format}
{plan : Posit.Configured.StoragePlan format}
{code : Type}
[ExecFloat.ModelCodec plan (Posit.Model format) code]
(target : Format)
(mode : RoundingMode)
(x : ExecFloat (Posit.Configured.Family format code plan))
:
Convert a configured posit to decimal through its exact model decoder.
Instances For
@[inline]
def
FloatLib.Floats.Formats.DecimalInterchange.Conversion.toConfiguredPosit
{format : Posit.Format}
{plan : Posit.Configured.StoragePlan format}
{code : Type}
[ExecFloat.ModelCodec plan (Posit.Model format) code]
(x : Datum)
:
ExecFloat (Posit.Configured.Family format code plan)
Convert decimal to the configured posit, with one model rounding and exact encoding.