From fb04c5e471c747790dc5a3d69b96b0292432fe3d Mon Sep 17 00:00:00 2001 From: Jakub Stasiak Date: Mon, 11 Aug 2025 16:30:36 +0200 Subject: [PATCH 1/2] 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. --- library/core/src/num/dec2flt/mod.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/library/core/src/num/dec2flt/mod.rs b/library/core/src/num/dec2flt/mod.rs index 1844cd9808268..93042bbf4919c 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. From 2f796d9021990cea2cd6de71155e05263e9ce3a2 Mon Sep 17 00:00:00 2001 From: Jakub Stasiak Date: Mon, 11 Aug 2025 16:42:09 +0200 Subject: [PATCH 2/2] Make a James Bond reference --- library/core/src/num/dec2flt/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/core/src/num/dec2flt/mod.rs b/library/core/src/num/dec2flt/mod.rs index 93042bbf4919c..3118a6e5ca62e 100644 --- a/library/core/src/num/dec2flt/mod.rs +++ b/library/core/src/num/dec2flt/mod.rs @@ -124,8 +124,8 @@ macro_rules! from_str_float_impl { /// * '2.5E-10' /// * '5.' /// * '.5', or, equivalently, '0.5' - /// * '5' - /// * '005' + /// * '7' + /// * '007' /// * 'inf', '-inf', '+infinity', 'NaN' /// /// Note that alphabetical characters are not case-sensitive.