Zig’s floats are strictly IEEE-compliant unless
@setFloatMode(.Optimized)
is used, which is equivalent to GCC’s -ffast-math. Floats coerce to larger
float types.
Floats support multiple kinds of literal.
Underscores may also be placed between digits.
Integers and floats may be converted using the built-in functions
@floatFromInt and
@intFromFloat.
@floatFromInt is
always safe, whereas
@intFromFloat is
detectable illegal behaviour if the float value cannot fit in the integer
destination type.