File tree Expand file tree Collapse file tree 2 files changed +2
-2
lines changed Expand file tree Collapse file tree 2 files changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -305,7 +305,6 @@ macro_rules! impl_Exp {
305305 n /= 10 ;
306306 exponent += 1 ;
307307 }
308- let trailing_zeros = exponent;
309308
310309 let ( added_precision, subtracted_precision) = match f. precision( ) {
311310 Some ( fmt_prec) => {
@@ -333,7 +332,7 @@ macro_rules! impl_Exp {
333332 n += 1 ;
334333 }
335334 }
336- ( n, exponent, trailing_zeros , added_precision)
335+ ( n, exponent, exponent , added_precision)
337336 } ;
338337
339338 // 39 digits (worst case u128) + . = 40
Original file line number Diff line number Diff line change @@ -146,6 +146,7 @@ fn test_format_int_exp_precision() {
146146 assert_eq ! ( format!( "{:.1000e}" , 1 ) , format!( "1.{}e0" , "0" . repeat( 1000 ) ) ) ;
147147 //test zero precision
148148 assert_eq ! ( format!( "{:.0e}" , 1 ) , format!( "1e0" , ) ) ;
149+ assert_eq ! ( format!( "{:.0e}" , 25 ) , format!( "3e1" , ) ) ;
149150
150151 //test padding with precision (and sign)
151152 assert_eq ! ( format!( "{:+10.3e}" , 1 ) , " +1.000e0" ) ;
You can’t perform that action at this time.
0 commit comments