64-bit floating-point numbers.
Float corresponds to the IEEE 754 binary64 format (double in C or f64 in Rust).
Floating-point numbers are a finite representation of a subset of the real numbers, extended with
extra βsentinelβ values that represent undefined and infinite results as well as separate positive
and negative zeroes. Arithmetic on floating-point numbers approximates the corresponding operations
on the real numbers by rounding the results to numbers that are representable, propagating error and
infinite values.
Floating-point numbers include subnormal numbers. Their special values are:
-
NaN, which denotes a class of βnot a numberβ values that result from operations such as dividing zero by zero, and -
Infand-Inf, which represent positive and infinities that result from dividing non-zero values by zero.
Like other low-level types, Float is special-cased by the Lean compiler to correspond to the C
double type. From the point of view of Lean's logic, Float is equivalent to Float.Model (via
the functions Float.toModel and Float.ofModel), which is itself a subtype of UInt64. Some of
the operations on Float are defined in terms of their Float.Model counterparts, while others
are opaque to Lean's kernel.
Constructor
Float.ofModel
Constructs a Float from a Float.Model.
Fields
toModel : Float.Model
Converts a Float into a Float.Model.