The logical model for the Float type.
This is defined as the type of UInt64 with the additional restriction that bit patterns encoding
a NaN must be exactly a chosen canonical NaN.
Most functions on Float.Model work by unpacking the Float.Model into the inductive type
UnpackedFloat, performing the operation there, and then repacking the result into a Float.Model.
It is not a goal of this development to serve as the basis for a general-purpose floating-point
library or to have any direct lemmas written about it at all. Rather, users interested in a library
about floating-point numbers should develop such a library completely separately, and users
interested in proving properties of their programs involving Float should prove that the
operations defined here are equivalent to the operations defined in the separate library and then
transfer lemmas from the library to the Float and Float32 types.
- toBits : UInt64
The underlying bit pattern of the
Float.Model. - valid : Format.binary64.Valid self.toBits.toBitVec
The underlying bit pattern is valid according to the IEEE
binary64format.
Instances For
Unpack a Float.Model into the corresponding UnpackedFloat.
Instances For
Pack an UnpackedFloat into the corresponding Float.Model.
This operation only gives a meaningful result if the float is
already correctly rounded for the Format.binary64 format.
Instances For
Compute the difference of two Float.Model.
Instances For
Compute the ordering between two Float.Model as specified by IEEE. Returns an
Option Ordering to account for the fact that NaN is incomparable with everything.
Also, positive and negative zero are equal.
Instances For
Determine whether a is less than or equal to b according to IEEE rules.
This is not a total ordering, and ≤ is not reflexive.
Instances For
Determine whether a is less than b according to IEEE rules.
This is not a total ordering.
Instances For
Determine whether a is equal to b according to IEEE rules.
This is not a reflexive relation.
Instances For
Returns true if the float represents a real number, i.e., it is neither infinite nor NaN.
Instances For
Returns true if the float is positive or negative infinity.
Instances For
Construct a Float.Model from its bit representation. This operation canonicalizes
all NaN inputs into the canonical NaN.
Instances For
Converts an Int to a Float.Model, returning positive zero on zero.
Instances For
Converts a Nat to a Float.Model, returning positive zero on zero.
Instances For
Converts a UInt8 to a Float.Model, returning positive zero on zero.
Instances For
Converts a UInt16 to a Float.Model, returning positive zero on zero.
Instances For
Converts a UInt32 to a Float.Model, returning positive zero on zero.
Instances For
Converts a UInt64 to a Float.Model, returning positive zero on zero.
Instances For
Converts a USize to a Float.Model, returning positive zero on zero.
Instances For
Converts an Int8 to a Float.Model, returning positive zero on zero.
Instances For
Converts an Int16 to a Float.Model, returning positive zero on zero.
Instances For
Converts an Int32 to a Float.Model, returning positive zero on zero.
Instances For
Converts an Int64 to a Float.Model, returning positive zero on zero.
Instances For
Converts an ISize to a Float.Model, returning positive zero on zero.
Instances For
Converts a Float.Model to a UInt8, truncating after the decimal point, sending NaN to
0 and clamping out-of-range values and infinities.
Instances For
Converts a Float.Model to a UInt16, truncating after the decimal point, sending NaN to
0 and clamping out-of-range values and infinities.
Instances For
Converts a Float.Model to a UInt32, truncating after the decimal point, sending NaN to
0 and clamping out-of-range values and infinities.
Instances For
Converts a Float.Model to a UInt64, truncating after the decimal point, sending NaN to
0 and clamping out-of-range values and infinities.
Instances For
Converts a Float.Model to a USize, truncating after the decimal point, sending NaN to
0 and clamping out-of-range values and infinities.
Instances For
Converts a Float.Model to an Int8, truncating after the decimal point, sending NaN to
0 and clamping out-of-range values and infinities.
Instances For
Converts a Float.Model to an Int16, truncating after the decimal point, sending NaN to
0 and clamping out-of-range values and infinities.
Instances For
Converts a Float.Model to an Int32, truncating after the decimal point, sending NaN to
0 and clamping out-of-range values and infinities.
Instances For
Converts a Float.Model to an Int64, truncating after the decimal point, sending NaN to
0 and clamping out-of-range values and infinities.
Instances For
Converts a Float.Model to an ISize, truncating after the decimal point, sending NaN to
0 and clamping out-of-range values and infinities.