Skip to content

Commit

Permalink
make float parsing docs more comprehensive
Browse files Browse the repository at this point in the history
  • Loading branch information
antonok-edm committed Mar 11, 2022
1 parent c5a43b8 commit 4c17217
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions library/core/src/num/dec2flt/mod.rs
Expand Up @@ -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]
/// ```
Expand Down

0 comments on commit 4c17217

Please sign in to comment.