File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -136,10 +136,10 @@ fn max_digits(fty: FloatTy) -> u32 {
136
136
137
137
/// Counts the digits excluding leading zeros
138
138
fn count_digits ( s : & str ) -> usize {
139
- // Note that s does not contain the f32/64 suffix
139
+ // Note that s does not contain the f32/64 suffix, and underscores have been stripped
140
140
s. chars ( )
141
- . filter ( |c| * c != '-' || * c != '.' )
142
- . take_while ( |c| * c != 'e' || * c != 'E' )
141
+ . filter ( |c| * c != '-' && * c != '.' )
142
+ . take_while ( |c| * c != 'e' && * c != 'E' )
143
143
. fold ( 0 , |count, c| {
144
144
// leading zeros
145
145
if c == '0' && count == 0 {
Original file line number Diff line number Diff line change @@ -67,4 +67,7 @@ fn main() {
67
67
68
68
// Inferred type
69
69
let good_inferred: f32 = 1f32 * 1_000_000_000. ;
70
+
71
+ // issue #2840
72
+ let num = 0.000_000_000_01e-10f64 ;
70
73
}
You can’t perform that action at this time.
0 commit comments