The logical model for the Float32 type.
This is defined as the type of UInt32 with the additional restriction that bit patterns encoding
a NaN must be exactly a chosen canonical NaN.
Most functions on Float32.Model work by unpacking the Float32.Model into the inductive type
UnpackedFloat, performing the operation there, and then repacking the result into a
Float32.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 Float32 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 : UInt32
The underlying bit pattern of the
Float32.Model. - valid : Float.Model.Format.binary32.Valid self.toBits.toBitVec
The underlying bit pattern is valid according to the IEEE
binary32format.
Instances For
Unpack a Float32.Model into the corresponding UnpackedFloat.
Instances For
Pack an UnpackedFloat into the corresponding Float32.Model.
This operation only gives a meaningful result if the float is
already correctly rounded for the Format.binary32 format.
Instances For
Compute the difference of two Float32.Model.
Instances For
Compute the product of two Float32.Model.
Instances For
Compute the quotient of two Float32.Model.
Instances For
Compute the square root of a Float32.Model.
Instances For
Return a Float32.Model with positive sign.
Instances For
Compute the ordering between two Float32.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 Float32.Model from its bit representation. This operation canonicalizes
all NaN inputs into the canonical NaN.
Instances For
Converts an Int to a Float32.Model, returning positive zero on zero.
Instances For
Converts a Nat to a Float32.Model, returning positive zero on zero.
Instances For
Converts a UInt8 to a Float32.Model, returning positive zero on zero.
Instances For
Converts a UInt16 to a Float32.Model, returning positive zero on zero.
Instances For
Converts a UInt32 to a Float32.Model, returning positive zero on zero.
Instances For
Converts a UInt64 to a Float32.Model, returning positive zero on zero.
Instances For
Converts a USize to a Float32.Model, returning positive zero on zero.
Instances For
Converts an Int8 to a Float32.Model, returning positive zero on zero.
Instances For
Converts an Int16 to a Float32.Model, returning positive zero on zero.
Instances For
Converts an Int32 to a Float32.Model, returning positive zero on zero.
Instances For
Converts an Int64 to a Float32.Model, returning positive zero on zero.
Instances For
Converts an ISize to a Float32.Model, returning positive zero on zero.
Instances For
Converts a Float32.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 Float32.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 Float32.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 Float32.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 Float32.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 Float32.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 Float32.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 Float32.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 Float32.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 Float32.Model to an ISize, truncating after the decimal point, sending NaN to
0 and clamping out-of-range values and infinities.