* FW: NAN and complex.h
@ 2008-05-14 14:31 이종민
0 siblings, 0 replies; only message in thread
From: 이종민 @ 2008-05-14 14:31 UTC (permalink / raw)
To: linux-c-programming
-----Original Message-----
From: linux-c-programming-owner@vger.kernel.org [mailto:linux-c-programming-
owner@vger.kernel.org] On Behalf Of Lukasz Mielicki
Sent: Monday, September 24, 2007 3:31 PM
To: linux-c-programming@vger.kernel.org
Subject: Re: NAN and complex.h
> Hi I made a program which basically averages data from a file. The
> data is stored as complex float and I'm reading it with fread with no
problem.
> Some
> data are taged as NAN (at least ENVI, an image procesing soft read
> these values as NAN). If I average the whole data adding a number with
> a NAN gives me a NAN and my whole program fails.
>
> What I did is the folowing which doesn't seems to work:
>
> if(cabsf(zhhzhh)!= NAN)
> {
> printf("%f\n", cabsf(zhhzhh));
> }
>
> For some reason the test seeams to be positive all the time, I keep
> printing NAN's ("nan" actualy).
>
> Any idea?
use isnan or isfinite to check for wrong values
BX
-
To unsubscribe from this list: send the line "unsubscribe linux-c-
programming" in the body of a message to majordomo@vger.kernel.org More
majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2008-05-14 14:31 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-14 14:31 FW: NAN and complex.h 이종민
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).