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