Float¶
No import is needed.
Read the usage guide for examples and common tasks. This reference lists the public declarations for this part of the library. See Reading API signatures for parameter and result notation.
compare¶
Orders this value against other (negative/zero/positive).
abs¶
Absolute value of this float.
min¶
The smaller of this and other.
max¶
The larger of this and other.
clamp¶
Returns this value limited to the inclusive range lo through hi. NaN is returned unchanged; the result is unspecified when lo is greater than hi.
signum¶
Returns 1.0 for a positive value, -1.0 for a negative value, and the value itself for zero (keeping the sign of -0.0) or NaN.
to_string¶
Returns the shortest decimal text that rounds back to exactly this value, so 0.1f prints as 0.1. The layout, NaN, infinity, and zero spellings match double.to_string.
parse¶
Parses a decimal float from text.