| ... | ... | @@ -757,8 +757,6 @@ pub fn formatFloatDecimal( |
| 757 | 757 | } else { |
| 758 | 758 | try output(context, ".0"); |
| 759 | 759 | } |
| 760 | | } else { |
| 761 | | try output(context, "0"); |
| 762 | 760 | } |
| 763 | 761 | |
| 764 | 762 | return; |
| ... | ... | @@ -1399,6 +1397,7 @@ test "float.special" { |
| 1399 | 1397 | |
| 1400 | 1398 | test "float.decimal" { |
| 1401 | 1399 | try testFmt("f64: 152314000000000000000000000000", "f64: {d}", .{@as(f64, 1.52314e+29)}); |
| 1400 | try testFmt("f32: 0", "f32: {d}", .{@as(f32, 0.0)}); |
| 1402 | 1401 | try testFmt("f32: 1.1", "f32: {d:.1}", .{@as(f32, 1.1234)}); |
| 1403 | 1402 | try testFmt("f32: 1234.57", "f32: {d:.2}", .{@as(f32, 1234.567)}); |
| 1404 | 1403 | // -11.1234 is converted to f64 -11.12339... internally (errol3() function takes f64). |