On 01/14/2013 03:50 PM, Marc Glisse wrote:
On Mon, 14 Jan 2013, Mischa Baars wrote:
When running the example attached, you can see the compiler fails to
recognize not-a-number's properly.
Bug reports go to bugzilla.
NaN doesn't compare equal to anything. x==x is actually the usual way
to te
On Mon, 14 Jan 2013, Mischa Baars wrote:
When running the example attached, you can see the compiler fails to
recognize not-a-number's properly.
Bug reports go to bugzilla.
NaN doesn't compare equal to anything. x==x is actually the usual way to
test if x is NaN.
--
Marc Glisse
On 01/14/2013 08:34 AM, Mischa Baars wrote:
> When running the example attached, you can see the compiler fails to
> recognize not-a-number's properly.
>
> Anyone who would like to have a look?
Comparing NaN with anything always returns false. Even when comparing
with NaN.
You want:
i
On Mon, Jan 14, 2013 at 9:34 AM, Mischa Baars wrote:
> Hi,
>
> When running the example attached, you can see the compiler fails to
> recognize not-a-number's properly.
>
> Anyone who would like to have a look?
THat's how FP works. Use isnan().
Richard.
> Regards,
> Mischa.
Hi,
When running the example attached, you can see the compiler fails to
recognize not-a-number's properly.
Anyone who would like to have a look?
Regards,
Mischa.
#include
#include
int main()
{
double x = NAN;
if (x == NAN)
{
printf("found a not-a-number\n");
}
return;
}