This is the mail archive of the
mailing list for the GCC project.
Re: [gfortran] patch for PR 15292 missing round and roundf
(2) We can include a implementation of fpclassify(). I don't have
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.