Skip to content

Commit 4c17217

Browse files
committed
make float parsing docs more comprehensive
1 parent c5a43b8 commit 4c17217

File tree

1 file changed

+8
-5
lines changed
  • library/core/src/num/dec2flt

1 file changed

+8
-5
lines changed

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

+8-5
Original file line numberDiff line numberDiff line change
@@ -112,21 +112,24 @@ macro_rules! from_str_float_impl {
112112
/// * '2.5E-10'
113113
/// * '5.'
114114
/// * '.5', or, equivalently, '0.5'
115-
/// * 'inf', '-inf', 'NaN'
115+
/// * 'inf', '-inf', '+infinity', 'NaN'
116+
///
117+
/// Note that alphabetical characters are not case-sensitive.
116118
///
117119
/// Leading and trailing whitespace represent an error.
118120
///
119121
/// # Grammar
120122
///
121-
/// All strings that adhere to the following [EBNF] grammar
122-
/// will result in an [`Ok`] being returned:
123+
/// All strings that adhere to the following [EBNF] grammar when
124+
/// lowercased will result in an [`Ok`] being returned:
123125
///
124126
/// ```txt
125-
/// Float ::= Sign? ( 'inf' | 'NaN' | Number )
127+
/// Float ::= Sign? ( 'inf' | 'infinity' | 'nan' | Number )
126128
/// Number ::= ( Digit+ |
129+
/// '.' Digit* |
127130
/// Digit+ '.' Digit* |
128131
/// Digit* '.' Digit+ ) Exp?
129-
/// Exp ::= [eE] Sign? Digit+
132+
/// Exp ::= 'e' Sign? Digit+
130133
/// Sign ::= [+-]
131134
/// Digit ::= [0-9]
132135
/// ```

0 commit comments

Comments
 (0)