PR32083 - Use correct sign for -Inf in real.c's mpfr_from_real
Tobias Burnus
burnus@net-b.de
Sun May 27 08:21:00 GMT 2007
Brooks Moses schrieb:
>> + mpfr_set_inf (m, r->sign == 1 ? -1 : 1);
> It looks like all of the other uses of "sign" in real.c leave off the
> "== 1", and just have "r->sign ? -1 : 1", so this should probably be
> changed to that form.
I think the other are ok and this is the only place where
REAL_VALUE_TYPE and mpfr are used in the same command. As long as one
has only REAL_VALUE_TYPE's signs or only mpfr signs, one remains consistent.
(The other place where mpfr and REAL_VALUE_TYPE are used together is
real_from_mpfr, but that one is ok:
if (mpfr_sgn (m) < 0)
*r = REAL_VALUE_NEGATE (*r);
)
> I'm obviously not a middle-end maintainer, but I _did_ write the code
> in question, and this correction seems obvious to me, so I think it's
> okay to commit on that basis.
I committed it now as obvious (r125108).
Tobias
More information about the Fortran
mailing list