commit 3d4219bb46a3f2072a01680591f823e3c44bd19b
parent 5dd2f47cc59173ff36e3cf323e64e35902c8285a
Author: Sudipto Mallick <smlckz@envs.net>
Date: Sat, 3 Apr 2021 13:16:58 +0000
fix printing of floating point numbers in ssa
The floating point numbers were truncated to six digits after decimal point for the usage of `%f`
Diffstat:
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/emit.c b/src/emit.c
@@ -94,10 +94,10 @@ emit_const(struct qbe_value *val, FILE *out)
fprintf(out, "%lu", val->lval);
break;
case Q_SINGLE:
- fprintf(out, "s_%f", val->sval);
+ fprintf(out, "s_%.8g", val->sval);
break;
case Q_DOUBLE:
- fprintf(out, "d_%f", val->dval);
+ fprintf(out, "d_%.16g", val->dval);
break;
case Q__VOID:
case Q__AGGREGATE: