Print real constant value comment with %g
The comment that shows the intended value for real constants was being printed with a %f. This is wrong for large or small values. This patch changes the %f to a %g to get more consistent results.
This commit is contained in:
parent
0fa223434e
commit
52a346ab38
|
|
@ -172,7 +172,7 @@ static int draw_realnum_real(ivl_expr_t exp)
|
|||
assert(vexp < 0x2000);
|
||||
vexp += sign;
|
||||
|
||||
fprintf(vvp_out, " %%loadi/wr %d, %lu, %d; load=%f\n",
|
||||
fprintf(vvp_out, " %%loadi/wr %d, %lu, %d; load=%g\n",
|
||||
res, mant, vexp, ivl_expr_dvalue(exp));
|
||||
|
||||
/* Capture the residual bits, if there are any. Note that an
|
||||
|
|
@ -190,7 +190,7 @@ static int draw_realnum_real(ivl_expr_t exp)
|
|||
|
||||
if (mant != 0) {
|
||||
int tmp_word = allocate_word();
|
||||
fprintf(vvp_out, " %%loadi/wr %d, %lu, %d; load=%f\n",
|
||||
fprintf(vvp_out, " %%loadi/wr %d, %lu, %d; load=%g\n",
|
||||
tmp_word, mant, vexp, ivl_expr_dvalue(exp));
|
||||
fprintf(vvp_out, " %%add/wr %d, %d;\n", res, tmp_word);
|
||||
clr_word(tmp_word);
|
||||
|
|
|
|||
Loading…
Reference in New Issue