Home / Docs / Specification / 29. Numerics
29.1 The type
Release v0.4.0
F64is a built-in type: an IEEE 754 binary64 value. Its values are every binary64 value that is not a NaN, and one NaN, the canonical NaN, whose bits are0x7FF8000000000000(positive, quiet, payload zero). There is no other NaN in the language (§6).- Distinct.
F64is distinct fromIntand from every fixed-width integer. An operator with anF64and an integer operand is U2001, with a repair that converts the integer byto_f64()(§4). - Refinements, type arguments and labels.
F64MAY be refined (kind Unit01 = F64 where it.ieee_ge(other: 0.0) and it <= 1.0).F64is a legal type argument (List[F64],Map[F64, Text]) and carries labels asIntdoes (spec/07). - Names. A user kind, variant, capability or unit named
F64is U1002. - Constraints (spec/20 §1).
F64satisfiesEqandOrd(§5), and neverInteger. Sosort,min,max,containsandMap[F64, V]accept it, andsumdoes not: a sum of floats depends on its order, so a program writes it withfold, in the order it chooses.