Fix parsing bug in floats.
This commit is contained in:
@ -104,6 +104,8 @@ static cell_t fconvert(const char *pos, cell_t n, float *ret) {
|
||||
} else if (*pos == '.') {
|
||||
if (has_dot) { return 0; }
|
||||
has_dot = -1;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
++pos;
|
||||
}
|
||||
|
||||
@ -99,3 +99,8 @@ e: test-afliteral
|
||||
foo
|
||||
out: 123.000000
|
||||
;e
|
||||
|
||||
e: test-float-broken-parse
|
||||
internals
|
||||
s" teste" f>number? 0= assert
|
||||
;e
|
||||
|
||||
Reference in New Issue
Block a user