PR32083 - Use correct sign for -Inf in real.c's mpfr_from_real

Brooks Moses brooks.moses@codesourcery.com
Sun May 27 08:39:00 GMT 2007


Tobias Burnus wrote:
> 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.

I think I must have been unclear.  I was not objecting to what your code 
was doing, merely to how you wrote it, and the part I was talking about 
has nothing at all to do with MPFR....

All I'm saying is that that line should be written as

       mpfr_set_inf (m, r->sign ? -1 : 1);

in order to be consistent with how r->sign is tested in the other places 
in real.c where it is tested.  The effect should be the same; it's just 
a stylistic choice.

- Brooks



More information about the Fortran mailing list