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:
  • ↑Praise for Russ Cox's foundational work underlying the improvements
  • ↑Appreciation for serious, hand-crafted software engineering still happening
  • ↑Enthusiasm for specific improvements like 128-bit float performance
  • ~Questioning the benchmark claims comparing to zmij's known speed
  • ↓Skepticism about Zig's future viability given Rust's AI-driven popularity