io/print_float always-emit-.0 #7

Closed
opened 2026-05-20 13:21:57 +02:00 by Brummel · 0 comments
Owner

Surface printer always emits . or e/E so re-lex routes to Float; the runtime printer (printf("%g\n", v)) doesn't, so 2.0 prints as 2 (Int-shaped). Asymmetric. Either switch the runtime path to a .0-fallback printer (matching surface) or document the %g contract in DESIGN.md §"Float semantics" so the LLM-author knows io/print_float's output is for-humans not round-trip.

context: docs/specs/2026-05-10-fieldtest-floats.md finding F1.

Surface printer always emits `.` or `e/E` so re-lex routes to Float; the runtime printer (`printf("%g\n", v)`) doesn't, so `2.0` prints as `2` (Int-shaped). Asymmetric. Either switch the runtime path to a `.0`-fallback printer (matching surface) or document the `%g` contract in DESIGN.md §"Float semantics" so the LLM-author knows `io/print_float`'s output is for-humans not round-trip. **context:** `docs/specs/2026-05-10-fieldtest-floats.md` finding F1.
Brummel added the bug label 2026-05-20 15:29:34 +02:00
Sign in to join this conversation.