Fix parsing bug in floats.

This commit is contained in:
Brad Nelson
2022-02-11 20:10:42 -08:00
parent 74125fc19e
commit 5421f829a6
2 changed files with 7 additions and 0 deletions

View File

@ -104,6 +104,8 @@ static cell_t fconvert(const char *pos, cell_t n, float *ret) {
} else if (*pos == '.') { } else if (*pos == '.') {
if (has_dot) { return 0; } if (has_dot) { return 0; }
has_dot = -1; has_dot = -1;
} else {
return 0;
} }
++pos; ++pos;
} }

View File

@ -99,3 +99,8 @@ e: test-afliteral
foo foo
out: 123.000000 out: 123.000000
;e ;e
e: test-float-broken-parse
internals
s" teste" f>number? 0= assert
;e