Skip to content

Commit 16c81fa

Browse files
committed
Document the numeric value returned by string parsing for floats
1 parent 6fa061c commit 16c81fa

File tree

1 file changed

+4
-2
lines changed
  • library/core/src/num/dec2flt

1 file changed

+4
-2
lines changed

library/core/src/num/dec2flt/mod.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,10 @@ macro_rules! from_str_float_impl {
143143
/// # Return value
144144
///
145145
/// `Err(ParseFloatError)` if the string did not represent a valid
146-
/// number. Otherwise, `Ok(n)` where `n` is the floating-point
147-
/// number represented by `src`.
146+
/// number. Otherwise, `Ok(n)` where `n` is the closest
147+
/// representable floating-point number to the number represented
148+
/// by `src` (following the same rules for rounding as for the
149+
/// results of primitive operations).
148150
#[inline]
149151
fn from_str(src: &str) -> Result<Self, ParseFloatError> {
150152
dec2flt(src)

0 commit comments

Comments
 (0)