mirror of
https://github.com/rust-lang/rust.git
synced 2025-04-28 11:07:42 +00:00
make float parsing docs more comprehensive
This commit is contained in:
parent
c5a43b8d39
commit
4c17217f99
@ -112,21 +112,24 @@ macro_rules! from_str_float_impl {
|
|||||||
/// * '2.5E-10'
|
/// * '2.5E-10'
|
||||||
/// * '5.'
|
/// * '5.'
|
||||||
/// * '.5', or, equivalently, '0.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.
|
/// Leading and trailing whitespace represent an error.
|
||||||
///
|
///
|
||||||
/// # Grammar
|
/// # Grammar
|
||||||
///
|
///
|
||||||
/// All strings that adhere to the following [EBNF] grammar
|
/// All strings that adhere to the following [EBNF] grammar when
|
||||||
/// will result in an [`Ok`] being returned:
|
/// lowercased will result in an [`Ok`] being returned:
|
||||||
///
|
///
|
||||||
/// ```txt
|
/// ```txt
|
||||||
/// Float ::= Sign? ( 'inf' | 'NaN' | Number )
|
/// Float ::= Sign? ( 'inf' | 'infinity' | 'nan' | Number )
|
||||||
/// Number ::= ( Digit+ |
|
/// Number ::= ( Digit+ |
|
||||||
|
/// '.' Digit* |
|
||||||
/// Digit+ '.' Digit* |
|
/// Digit+ '.' Digit* |
|
||||||
/// Digit* '.' Digit+ ) Exp?
|
/// Digit* '.' Digit+ ) Exp?
|
||||||
/// Exp ::= [eE] Sign? Digit+
|
/// Exp ::= 'e' Sign? Digit+
|
||||||
/// Sign ::= [+-]
|
/// Sign ::= [+-]
|
||||||
/// Digit ::= [0-9]
|
/// Digit ::= [0-9]
|
||||||
/// ```
|
/// ```
|
||||||
|
Loading…
Reference in New Issue
Block a user