aboutsummaryrefslogtreecommitdiff
path: root/src/ast_render.cpp
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2017-08-20 00:33:05 -0400
committerAndrew Kelley <superjoe30@gmail.com>2017-08-20 01:04:51 -0400
commit09bd4a9a8693485fa87a5f62af90540ca8ce9d47 (patch)
tree295ed2543f174d014dd85acd95181e615d2f24f8 /src/ast_render.cpp
parentc73a0c92d0b8736b0473b10bd5deacf62e0753d8 (diff)
downloadzig-09bd4a9a8693485fa87a5f62af90540ca8ce9d47.tar.gz
zig-09bd4a9a8693485fa87a5f62af90540ca8ce9d47.zip
compile-time f32, f64 operations are now correctly lossy
previously we used the bigfloat abstraction to do all compile-time float math. but runtime code and comptime code are supposed to get the same result. so now if you add a f32 to a f32 at compile time it does it with f32 math instead of the bigfloat. float literals still get the bigfloat math. closes #424
Diffstat (limited to 'src/ast_render.cpp')
-rw-r--r--src/ast_render.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/ast_render.cpp b/src/ast_render.cpp
index 5613347f7d..23a83fadd0 100644
--- a/src/ast_render.cpp
+++ b/src/ast_render.cpp
@@ -540,7 +540,7 @@ static void render_node_extra(AstRender *ar, AstNode *node, bool grouped) {
{
Buf rendered_buf = BUF_INIT;
buf_resize(&rendered_buf, 0);
- bigfloat_write_buf(&rendered_buf, node->data.float_literal.bigfloat);
+ bigfloat_append_buf(&rendered_buf, node->data.float_literal.bigfloat);
fprintf(ar->f, "%s", buf_ptr(&rendered_buf));
}
break;
@@ -548,7 +548,7 @@ static void render_node_extra(AstRender *ar, AstNode *node, bool grouped) {
{
Buf rendered_buf = BUF_INIT;
buf_resize(&rendered_buf, 0);
- bigint_write_buf(&rendered_buf, node->data.int_literal.bigint, 10);
+ bigint_append_buf(&rendered_buf, node->data.int_literal.bigint, 10);
fprintf(ar->f, "%s", buf_ptr(&rendered_buf));
}
break;