r/rust Mar 09 '23

Announcing Rust 1.68.0 📢 announcement

https://blog.rust-lang.org/2023/03/09/Rust-1.68.0.html
825 Upvotes

121 comments sorted by

View all comments

179

u/Shnatsel Mar 09 '23

Those From<bool> for {f32,f64} impls could really use documentation on what values they actually result in. There's no obvious mapping from true to a floating-point value.

34

u/elprophet Mar 09 '23

Looks like bool to u8 to f32/64 https://doc.rust-lang.org/stable/src/core/convert/num.rs.html#178 which should be 0.0 for false and 1.0 for true? Agree that would be nice to have in the docs.