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:
Cary R 2008-01-16 17:52:57 -08:00 committed by Stephen Williams
parent 0fa223434e
commit 52a346ab38
1 changed files with 2 additions and 2 deletions

View File

@ -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);