There is arguably no obvious mapping from a Boolean to a float so implementation of From<bool>
for f32
and f64
should document its outputs
#108939
Labels
A-docs
Area: documentation for any part of the project, including the compiler, standard library, and tools
A-floating-point
Area: Floating point numbers and arithmetic
Location
https://doc.rust-lang.org/stable/std/primitive.f32.html#impl-From%3Cbool%3E-for-f32
Summary
In Rust 1.68.0,
From<bool>
is implemented onf32
andf64
. It is not very clear how a Boolean value could be converted into a float and the documentation offers no explanation - I had to look at the actual implementation to figure out the output value. It seems sensible that the output of this implementation ofFrom
be given in the documentation.The text was updated successfully, but these errors were encountered: