float literals now parse using musl's 128 bit float code

fixes float literals not having 128 bit precision
This commit is contained in:
Andrew Kelley committed 2019-03-22 14:56:03 -04:00
1 parent 127bb124a0
commit 4615ed5ea0
9 files changed
+1090 -25

No files matched your search

+2 -2
View File
@@ -293,10 +293,10 @@ static void cancel_token(Tokenize *t) {
}
static void end_float_token(Tokenize *t) {
if (t->radix == 10) {
if (t->radix == 10 || t->radix == 16) {
uint8_t *ptr_buf = (uint8_t*)buf_ptr(t->buf) + t->cur_tok->start_pos;
size_t buf_len = t->cur_tok->end_pos - t->cur_tok->start_pos;
if (bigfloat_init_buf_base10(&t->cur_tok->data.float_lit.bigfloat, ptr_buf, buf_len)) {
if (bigfloat_init_buf(&t->cur_tok->data.float_lit.bigfloat, ptr_buf, buf_len)) {
t->cur_tok->data.float_lit.overflow = true;
}
return;