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 == '.') {
|
} else if (*pos == '.') {
|
||||||
if (has_dot) { return 0; }
|
if (has_dot) { return 0; }
|
||||||
has_dot = -1;
|
has_dot = -1;
|
||||||
|
} else {
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
++pos;
|
++pos;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user