Re: Question on performance
On 2010-10-15 15:02:32 +0100, N.M. Maclaren wrote:
> On Oct 15 2010, Vincent Lefevre wrote:
> >On 2010-10-15 06:37:54 -0400, Michel Hack wrote:
> >>
> >>> ... It's strange that GCC doesn't replace isnan() by a test x != x
> >>
> >>Perhaps because these are NOT equivalent?
> >
> >I think they are on conforming code.
>
> Oh, no, they're not - not even remotely!
>
> Mainly, unless the implementation defines __STDC_IEC_559__ to be 1, the
[...]
What I meant is that isnan() and x != x can be seen as equivalent
even if __STDC_IEC_559__ is 1. AFAIK, the C standard doesn't
provide a specified way to create a signaling NaN. That's what
Note 309 says if I understand correctly:
309) Since NaNs created by IEC 60559 operations are always quiet,
quiet NaNs (along with infinities) are sufficient for closure
of the arithmetic.
--
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)