From abbfe793e033b04e935e64c330a37e2a773f624e Mon Sep 17 00:00:00 2001 From: gingerBill Date: Fri, 19 Jun 2026 09:20:26 +0100 Subject: [PATCH] `fmt` on `h'` floats: force the width to always be bit_size/4 to accurately represent the number --- core/fmt/fmt.odin | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/fmt/fmt.odin b/core/fmt/fmt.odin index 3118e7e5e..3ef5a13e6 100644 --- a/core/fmt/fmt.odin +++ b/core/fmt/fmt.odin @@ -1456,9 +1456,11 @@ fmt_float :: proc(fi: ^Info, v: f64, bit_size: int, verb: rune) { prev_fi := fi^ defer fi^ = prev_fi fi.hash = false - fi.width = bit_size fi.zero = true fi.plus = false + // force the width to always be bit_size/4 to accurately represent the number + fi.width = bit_size/4 + fi.width_set = true u: u64 switch bit_size {