This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [gfortran] patch for PR 15292 missing round and roundf


(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



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]