linux-c-programming.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: 이종민 <anapple.orange@gmail.com>
To: linux-c-programming@vger.kernel.org
Subject: FW: NAN and complex.h
Date: Wed, 14 May 2008 23:31:47 +0900	[thread overview]
Message-ID: <D9FA32E4672744FA8FA42D9CE4309C24@OrangeMini> (raw)

 

-----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


                 reply	other threads:[~2008-05-14 14:31 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=D9FA32E4672744FA8FA42D9CE4309C24@OrangeMini \
    --to=anapple.orange@gmail.com \
    --cc=linux-c-programming@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).