about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMatthew Woodcraft <matthew@woodcraft.me.uk>2022-04-16 22:00:37 +0100
committerMatthew Woodcraft <matthew@woodcraft.me.uk>2022-04-16 22:03:24 +0100
commit16c81fa9a6b0e5b56320baa7ca569e024425344e (patch)
tree9009cad087036c43c10ad9f7289590a817ab2da5
parent6fa061c5f96120e631678e3f449566f786397014 (diff)
downloadrust-16c81fa9a6b0e5b56320baa7ca569e024425344e.tar.gz
rust-16c81fa9a6b0e5b56320baa7ca569e024425344e.zip
Document the numeric value returned by string parsing for floats
-rw-r--r--library/core/src/num/dec2flt/mod.rs6
1 files 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 @@ macro_rules! from_str_float_impl {
             /// # 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<Self, ParseFloatError> {
                 dec2flt(src)