Xref: utzoo comp.unix.ultrix:7448 comp.lang.fortran:5567 Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!ogicse!milton!atmos.washington.edu!warren From: warren@atmos.washington.edu (David Warren) Newsgroups: comp.unix.ultrix,comp.lang.fortran Subject: Re: How to detect NaN's Message-ID: Date: 1 Jun 91 00:44:33 GMT References: <1991May30.204332.16506@litwin.com> Sender: news@milton.u.washington.edu (News) Organization: Dept. of Atmospheric Sciences, University of Washington Lines: 40 In-Reply-To: vlr@litwin.com's message of 30 May 91 20:43:32 GMT In article <1991May30.204332.16506@litwin.com> vlr@litwin.com (Vic Rice) writes: Xref: milton comp.unix.ultrix:6260 comp.lang.fortran:3304 Path: milton!hayes.ims.alaska.edu!bionet!uwm.edu!zaphod.mps.ohio-state.edu!swrinde!cs.utexas.edu!uunet!dynsim1!litwin!vlr From: vlr@litwin.com (Vic Rice) Newsgroups: comp.unix.ultrix,comp.lang.fortran Date: 30 May 91 20:43:32 GMT Organization: Litwin Process Automation Lines: 9 I have encountered a problem on a DECStation 5000 using the Mips Fortran compiler. Some operation I am performing is generating a NaN which then proceeds to propogate to other dependent variables. Since this is in a loop, I am not exactly sure where it starts. How can I test a variable for the presence of a NaN or Infinity ??? -- Dr. Victor L. Rice Litwin Process Automation how about linking with this c function: int *check_nan_(num) /*make sure num != NaN*/ float *num; { int true=1,false=0; if(isnan((double)num))return(&true); else return(&false); } then do ISTAT = CHECK_NAN(RVAL) -- David Warren INTERNET: warren@atmos.washington.edu (206) 543-0945 UUCP: uw-beaver!atmos.washington.edu!warren Dept of Atmospheric Sciences, AK-40 University of Washington