aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgingerBill <gingerBill@users.noreply.github.com>2023-01-28 23:31:57 +0000
committerGitHub <noreply@github.com>2023-01-28 23:31:57 +0000
commit0ccc570ef25973dbf5de2d4994943344d37f9eea (patch)
tree4aaacababa877a2e4ce198da6bc74508fcd397ba
parentc45ca1bfcccb9b8f001a62a52c56eeeb5c73be88 (diff)
parenta3bb7d3028ab9e7768ea49208756bfb4a3489d76 (diff)
Merge pull request #2316 from Hyp-X/master
Fix decimal_to_float_bits for floats >= 1
-rw-r--r--core/strconv/generic_float.odin2
1 files changed, 1 insertions, 1 deletions
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' {