Re: Question on performance
On 2010-10-15 06:37:54 -0400, Michel Hack wrote:
> Vincent Lef?vre a ?crit:
> > ... It's strange that GCC doesn't replace isnan() by a test x != x
>
> Perhaps because these are NOT equivalent? They differ for SNaN.
I forgot: IEEE 754-1985 (which is what C99 Annex F is based on)
did not define isnan() anyway. Its non-normative appendix did,
but even in it, these two forms were equivalent:
Isnan(x), or equivalently x != x, returns the value TRUE if x is
a NaN, and returns FALSE otherwise.
--
Vincent Lefèvre <vincent@xxxxxxxxxx> - Web: <http://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / Arénaire project (LIP, ENS-Lyon)