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] |
(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.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |