File tree 2 files changed +2
-2
lines changed
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 {
305
305
n /= 10 ;
306
306
exponent += 1 ;
307
307
}
308
- let trailing_zeros = exponent;
309
308
310
309
let ( added_precision, subtracted_precision) = match f. precision( ) {
311
310
Some ( fmt_prec) => {
@@ -333,7 +332,7 @@ macro_rules! impl_Exp {
333
332
n += 1 ;
334
333
}
335
334
}
336
- ( n, exponent, trailing_zeros , added_precision)
335
+ ( n, exponent, exponent , added_precision)
337
336
} ;
338
337
339
338
// 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() {
146
146
assert_eq ! ( format!( "{:.1000e}" , 1 ) , format!( "1.{}e0" , "0" . repeat( 1000 ) ) ) ;
147
147
//test zero precision
148
148
assert_eq ! ( format!( "{:.0e}" , 1 ) , format!( "1e0" , ) ) ;
149
+ assert_eq ! ( format!( "{:.0e}" , 25 ) , format!( "3e1" , ) ) ;
149
150
150
151
//test padding with precision (and sign)
151
152
assert_eq ! ( format!( "{:+10.3e}" , 1 ) , " +1.000e0" ) ;
You can’t perform that action at this time.
0 commit comments