Executable exact logarithmic operations #
Every value is zero or a signed integral power of the radix. Multiplication is the only arithmetic operation supplied; it is closed and exact because signs xor and exponents add. Addition and arbitrary real conversion would require rounding because integral powers of the radix are not closed under addition. Division by a nonzero value could subtract exponents exactly, but no division operation or zero-divisor policy is supplied.
@[inline]
def
FloatLib.Floats.ExecFloat.Logarithmic.ofCode
{radix : Numerics.Radix}
(code : Formats.Logarithmic.Code radix)
:
Logarithmic radix
Wrap a complete logarithmic code without conversion.
Instances For
@[inline]
def
FloatLib.Floats.ExecFloat.Logarithmic.toCode
{radix : Numerics.Radix}
(value : Logarithmic radix)
:
Formats.Logarithmic.Code radix
Recover the complete logarithmic code without conversion.
Instances For
@[inline]
Construct the unique zero code.
Instances For
@[inline]
def
FloatLib.Floats.ExecFloat.Logarithmic.ofSignExponent
{radix : Numerics.Radix}
(negative : Bool)
(exponent : ℤ)
:
Logarithmic radix
Construct the exact value (-1)^negative * radix^exponent.
Instances For
@[inline]
noncomputable def
FloatLib.Floats.ExecFloat.Logarithmic.toReal
{radix : Numerics.Radix}
(value : Logarithmic radix)
:
Decode a configured logarithmic value to its exact real meaning.
Instances For
@[inline]
def
FloatLib.Floats.ExecFloat.Logarithmic.mul
{radix : Numerics.Radix}
(left right : Logarithmic radix)
:
Logarithmic radix
Exact multiplication of configured logarithmic values.