home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / lang / fortran / 3066 < prev    next >
Encoding:
Text File  |  1992-08-17  |  1.1 KB  |  35 lines

  1. Newsgroups: comp.lang.fortran
  2. Path: sparky!uunet!wupost!sdd.hp.com!mips!darwin.sura.net!uvaarpa!cv3.cv.nrao.edu!laphroaig!cflatter
  3. From: cflatter@nrao.edu (Chris Flatters)
  4. Subject: Re: how to quit on an NaN result?
  5. Message-ID: <1992Aug17.182748.18966@nrao.edu>
  6. Sender: news@nrao.edu
  7. Reply-To: cflatter@nrao.edu
  8. Organization: NRAO
  9. References: <1992Aug17.151505.18062@craycos.com>
  10. Date: Mon, 17 Aug 1992 18:27:48 GMT
  11. Lines: 22
  12.  
  13. In article 18062@craycos.com, jrbd@craycos.com (James Davies) writes:
  14. >In article <1992Aug16.221125.19419@ccu1.aukuni.ac.nz> ecmtwhk@ccu1.aukuni.ac.nz (Thomas Koenig) writes:
  15. >>Bruce.Scott@bbs.oit.unc.edu (Bruce Scott) writes:
  16. >>
  17. >>>How can I check forNaN's and quit when one arises.
  18. >>
  19. >>NaN's are supposed to fail every test, so
  20. >>
  21. >>      IF ((.NOT.AVAR.GE.0.) .AND. (.NOT.AVAR.LT.0.)) STOP
  22. >>
  23. >>should do the trick.
  24. >
  25. >Would this have the same effect?
  26. >
  27. >    IF (AVAR .NE. AVAR) STOP
  28.  
  29. It is preferable.  Not only does it only involve only one test but it will not
  30. raise an invalid operation flag if AVAR is a NaN (the former will).
  31.  
  32.     Chris Flatters
  33.     cflatter@nrao.edu
  34.  
  35.