From a3bb7d3028ab9e7768ea49208756bfb4a3489d76 Mon Sep 17 00:00:00 2001 From: Hyp-X Date: Sat, 28 Jan 2023 14:40:44 +0100 Subject: [PATCH] Fix decimal_to_float_bits for floats >= 1 --- core/strconv/generic_float.odin | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/strconv/generic_float.odin b/core/strconv/generic_float.odin index 78edf5ca8..b612b8eb2 100644 --- a/core/strconv/generic_float.odin +++ b/core/strconv/generic_float.odin @@ -326,7 +326,7 @@ decimal_to_float_bits :: proc(d: ^decimal.Decimal, info: ^Float_Info) -> (b: u64 exp = 0 for d.decimal_point > 0 { n := 27 if d.decimal_point >= len(power_table) else power_table[d.decimal_point] - decimal.shift(d, n) + decimal.shift(d, -n) exp += n } for d.decimal_point < 0 || d.decimal_point == 0 && d.digits[0] < '5' {