about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAnton Lazarev <antonok35@gmail.com>2022-03-10 22:20:46 -0800
committerAnton Lazarev <antonok35@gmail.com>2022-03-10 22:26:30 -0800
commit4c17217f99250892f859d2859aa0f17e949a6ebc (patch)
treed5af359839aad25490f60578a5c01a60f1ddcf51
parentc5a43b8d3917d15b30b7d99021540cf7831f4182 (diff)
downloadrust-4c17217f99250892f859d2859aa0f17e949a6ebc.tar.gz
rust-4c17217f99250892f859d2859aa0f17e949a6ebc.zip
make float parsing docs more comprehensive
-rw-r--r--library/core/src/num/dec2flt/mod.rs13
1 files changed, 8 insertions, 5 deletions
diff --git a/library/core/src/num/dec2flt/mod.rs b/library/core/src/num/dec2flt/mod.rs
index d45ba595f1b..541adb69b8e 100644
--- a/library/core/src/num/dec2flt/mod.rs
+++ b/library/core/src/num/dec2flt/mod.rs
@@ -112,21 +112,24 @@ macro_rules! from_str_float_impl {
             /// * '2.5E-10'
             /// * '5.'
             /// * '.5', or, equivalently, '0.5'
-            /// * 'inf', '-inf', 'NaN'
+            /// * 'inf', '-inf', '+infinity', 'NaN'
+            ///
+            /// Note that alphabetical characters are not case-sensitive.
             ///
             /// Leading and trailing whitespace represent an error.
             ///
             /// # Grammar
             ///
-            /// All strings that adhere to the following [EBNF] grammar
-            /// will result in an [`Ok`] being returned:
+            /// All strings that adhere to the following [EBNF] grammar when
+            /// lowercased will result in an [`Ok`] being returned:
             ///
             /// ```txt
-            /// Float  ::= Sign? ( 'inf' | 'NaN' | Number )
+            /// Float  ::= Sign? ( 'inf' | 'infinity' | 'nan' | Number )
             /// Number ::= ( Digit+ |
+            ///              '.' Digit* |
             ///              Digit+ '.' Digit* |
             ///              Digit* '.' Digit+ ) Exp?
-            /// Exp    ::= [eE] Sign? Digit+
+            /// Exp    ::= 'e' Sign? Digit+
             /// Sign   ::= [+-]
             /// Digit  ::= [0-9]
             /// ```