[gfortran] patch for PR 15292 missing round and roundf

Paolo Bonzini paolo.bonzini@polimi.it
Mon Jun 14 13:30:00 GMT 2004


>>>(2) We can include a implementation of fpclassify().  I don't have 
>>>   such code.
>>
>>if (x != x) can be used to check for NaN.
>>
>>if (x - x != 0.0) can be used to check for NaN or infinity.
>>
>>if (x + x == x) can be used to check for infinity or zero.
> 
> 
> Isn't fpclassify supposed not to generate any exceptions though?
> The second test will generate invalid exception while fpclassify
> will not (plus if one of the arguments is sNaN all 3 will throw
> exception while sNaN will not.

Yes, but Bud was asking in the context of round.  IIRC, round should 
generate an invalid exception if the parameter is a NaN.

Paolo




More information about the Gcc-patches mailing list