mirror of
https://github.com/ziglang/zig.git
synced 2026-11-22 04:37:39 -05:00
float literals now parse using musl's 128 bit float code
fixes float literals not having 128 bit precision
This commit is contained in:
9 files changed
+1090
-25
No files matched your search
+2
-2
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user