Skip to content

Commit 8d2bdb8

Browse files
committed
Add missing comment for f64
1 parent 73016bb commit 8d2bdb8

File tree

1 file changed

+2
-1
lines changed
  • library/core/src/convert

1 file changed

+2
-1
lines changed

library/core/src/convert/num.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,8 @@ impl const From<bool> for f32 {
182182
#[stable(feature = "float_from_bool", since = "1.68.0")]
183183
#[rustc_const_unstable(feature = "const_num_from_num", issue = "87852")]
184184
impl const From<bool> for f64 {
185-
/// Converts `bool` to `f64` losslessly.
185+
/// Converts `bool` to `f64` losslessly. The resulting value is positive
186+
/// `0.0` for `false` and `1.0` for `true` values.
186187
#[inline]
187188
fn from(small: bool) -> Self {
188189
small as u8 as Self

0 commit comments

Comments
 (0)