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

  1. Newsgroups: comp.lang.fortran
  2. Path: sparky!uunet!paladin.american.edu!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.222820.22019@nrao.edu>
  6. Sender: news@nrao.edu
  7. Reply-To: cflatter@nrao.edu
  8. Organization: NRAO
  9. References: <1992Aug17.155913.21922@ultb.isc.rit.edu>
  10. Date: Mon, 17 Aug 1992 22:28:20 GMT
  11. Lines: 17
  12.  
  13. In article 21922@ultb.isc.rit.edu, jsvrc@rc.rit.edu (J A Stephen Viggiano) writes:
  14. >A portable way is to use an internal write. Write a known NaN to
  15. >a character variable, use the substring that flags the result as a NaN.
  16. >Then, write the value you want to test to another character variable, and
  17. >compare *these* variables.
  18. >
  19.  
  20. This is unsafe.  A floating point implementation that conforms to IEEE-754
  21. must support at least two different NaN bit patterns (one signalling NaN
  22. and one non-signalling NaN) for each supported precision.
  23.  
  24.     Chris Flatters
  25.     cflatter@nrao.edu
  26.  
  27.  
  28.  
  29.  
  30.