Skip to main content

FLOAT

Constant FLOAT 

Source
pub const FLOAT: BuiltinSchema;
Expand description

Float: a 64-bit binary floating-point number.

parse fails on text that is not one, which is an expected failure and so a Result, exactly as Int.parse is. toInt is a Result for a second reason on top of that one: NaN, an infinity, and a magnitude Int has no room for are three ways a conversion can have nothing to answer, and a program that read the number out of a file is the program that should be handling them.

Float is IEEE 754 and stops at nothing, so nothing here traps: abs, round, sqrt, min, and max are total. format is the one exception, and what it refuses is its own argument rather than the value.