home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.fortran
- Path: sparky!uunet!wupost!sdd.hp.com!mips!darwin.sura.net!uvaarpa!cv3.cv.nrao.edu!laphroaig!cflatter
- From: cflatter@nrao.edu (Chris Flatters)
- Subject: Re: how to quit on an NaN result?
- Message-ID: <1992Aug17.182748.18966@nrao.edu>
- Sender: news@nrao.edu
- Reply-To: cflatter@nrao.edu
- Organization: NRAO
- References: <1992Aug17.151505.18062@craycos.com>
- Date: Mon, 17 Aug 1992 18:27:48 GMT
- Lines: 22
-
- In article 18062@craycos.com, jrbd@craycos.com (James Davies) writes:
- >In article <1992Aug16.221125.19419@ccu1.aukuni.ac.nz> ecmtwhk@ccu1.aukuni.ac.nz (Thomas Koenig) writes:
- >>Bruce.Scott@bbs.oit.unc.edu (Bruce Scott) writes:
- >>
- >>>How can I check forNaN's and quit when one arises.
- >>
- >>NaN's are supposed to fail every test, so
- >>
- >> IF ((.NOT.AVAR.GE.0.) .AND. (.NOT.AVAR.LT.0.)) STOP
- >>
- >>should do the trick.
- >
- >Would this have the same effect?
- >
- > IF (AVAR .NE. AVAR) STOP
-
- It is preferable. Not only does it only involve only one test but it will not
- raise an invalid operation flag if AVAR is a NaN (the former will).
-
- Chris Flatters
- cflatter@nrao.edu
-
-