| Zig gets improved float parser/formatter(codeberg.org) | |
| 271 points by Retro_Dev 3 days ago | 64 comments | |
tl;dr: Zig's standard library float parser/formatter has been updated, with stage3 now building successfully and correct upper-case inf/nan output for non-hex floats. The patch fixes several rounding and formatting bugs, including round-to-even errors (e.g., `1.00001e5`, `0.01563`, `3.1415`), unnecessary decimal output for `0x0.0p0`, and unnormalized hex float output. The new approach is claimed to be equally fast or faster while simplifying the mental model for callers. | |
HN Discussion:
| |