about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJakub Stasiak <jakub@stasiak.at>2025-08-11 16:30:36 +0200
committerJakub Stasiak <jakub@stasiak.at>2025-08-11 16:33:41 +0200
commitfb04c5e471c747790dc5a3d69b96b0292432fe3d (patch)
treea5830c9a785d8c84f4a405bb702baaa3d5016f61
parent577166503aee7290e09374da21f4045c455acfd5 (diff)
downloadrust-fb04c5e471c747790dc5a3d69b96b0292432fe3d.tar.gz
rust-fb04c5e471c747790dc5a3d69b96b0292432fe3d.zip
dec2flt: Provide more valid inputs examples
I was just looking at the specifics of how the parsing is handled here
and I wasn't sure if the examples were incomplete or the grammar below was
misleading.

The grammar was correct so I figured I'd add these examples to clarify.
-rw-r--r--library/core/src/num/dec2flt/mod.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/library/core/src/num/dec2flt/mod.rs b/library/core/src/num/dec2flt/mod.rs
index 1844cd98082..93042bbf491 100644
--- a/library/core/src/num/dec2flt/mod.rs
+++ b/library/core/src/num/dec2flt/mod.rs
@@ -124,6 +124,8 @@ macro_rules! from_str_float_impl {
             /// * '2.5E-10'
             /// * '5.'
             /// * '.5', or, equivalently, '0.5'
+            /// * '5'
+            /// * '005'
             /// * 'inf', '-inf', '+infinity', 'NaN'
             ///
             /// Note that alphabetical characters are not case-sensitive.