From 16c81fa9a6b0e5b56320baa7ca569e024425344e Mon Sep 17 00:00:00 2001 From: Matthew Woodcraft Date: Sat, 16 Apr 2022 22:00:37 +0100 Subject: [PATCH] Document the numeric value returned by string parsing for floats --- library/core/src/num/dec2flt/mod.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/library/core/src/num/dec2flt/mod.rs b/library/core/src/num/dec2flt/mod.rs index 541adb69b8e..df0e7431f1f 100644 --- a/library/core/src/num/dec2flt/mod.rs +++ b/library/core/src/num/dec2flt/mod.rs @@ -143,8 +143,10 @@ impl FromStr for $t { /// # Return value /// /// `Err(ParseFloatError)` if the string did not represent a valid - /// number. Otherwise, `Ok(n)` where `n` is the floating-point - /// number represented by `src`. + /// number. Otherwise, `Ok(n)` where `n` is the closest + /// representable floating-point number to the number represented + /// by `src` (following the same rules for rounding as for the + /// results of primitive operations). #[inline] fn from_str(src: &str) -> Result { dec2flt(src)