aboutsummaryrefslogtreecommitdiff
path: root/core/strconv
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2023-03-06 13:40:06 +0000
committergingerBill <bill@gingerbill.org>2023-03-06 13:40:06 +0000
commit8f1af2630d2996a110cac1688b4ca89f4dfc3184 (patch)
tree5e71e9232f9301e8cf090d87082100d3894051e5 /core/strconv
parenteea92a3371037d97cb141656d58ff5e14e7e3efc (diff)
Fix typo in `parse_components`
Diffstat (limited to 'core/strconv')
-rw-r--r--core/strconv/strconv.odin6
1 files changed, 4 insertions, 2 deletions
diff --git a/core/strconv/strconv.odin b/core/strconv/strconv.odin
index 816322aee..5c96f584c 100644
--- a/core/strconv/strconv.odin
+++ b/core/strconv/strconv.odin
@@ -2,6 +2,7 @@ package strconv
import "core:unicode/utf8"
import "decimal"
+import "core:runtime"
parse_bool :: proc(s: string, n: ^int = nil) -> (result: bool = false, ok: bool) {
switch s {
@@ -708,8 +709,8 @@ parse_f64_prefix :: proc(str: string) -> (value: f64, nr: int, ok: bool) {
saw_digits = true
nd += 1
if nd_mant < MAX_MANT_DIGITS {
- MAX_MANT_DIGITS *= 16
- MAX_MANT_DIGITS += int(lower(c) - 'a' + 10)
+ mantissa *= 16
+ mantissa += u64(lower(c) - 'a' + 10)
nd_mant += 1
} else {
trunc = true
@@ -835,6 +836,7 @@ parse_f64_prefix :: proc(str: string) -> (value: f64, nr: int, ok: bool) {
mantissa, exp, neg, trunc, hex, nr = parse_components(str) or_return
if hex {
+ runtime.println_any(mantissa, exp, neg, trunc, hex, nr)
value, ok = parse_hex(str, mantissa, exp, neg, trunc)
return
}