Commit 80e3412f by Ian Lance Taylor

compiler: Add explicit sign to exported complex constants without imaginary component.

Fixes issue 31.

From-SVN: r219273
parent 7d7d64c1
...@@ -2450,7 +2450,7 @@ Complex_expression::export_complex(String_dump* exp, const mpc_t val) ...@@ -2450,7 +2450,7 @@ Complex_expression::export_complex(String_dump* exp, const mpc_t val)
if (!mpfr_zero_p(mpc_realref(val))) if (!mpfr_zero_p(mpc_realref(val)))
{ {
Float_expression::export_float(exp, mpc_realref(val)); Float_expression::export_float(exp, mpc_realref(val));
if (mpfr_sgn(mpc_imagref(val)) > 0) if (mpfr_sgn(mpc_imagref(val)) >= 0)
exp->write_c_string("+"); exp->write_c_string("+");
} }
Float_expression::export_float(exp, mpc_imagref(val)); Float_expression::export_float(exp, mpc_imagref(val));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment