Xref: utzoo comp.unix.ultrix:7465 comp.lang.fortran:5586 Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!usc!samsung!sol.ctr.columbia.edu!emory!hubcap!elwin From: elwin@hubcap.clemson.edu (lawrence brown) Newsgroups: comp.unix.ultrix,comp.lang.fortran Subject: Re: How to detect NaN's Message-ID: <1991Jun3.143050.20493@hubcap.clemson.edu> Date: 3 Jun 91 14:30:50 GMT References: <1991May30.204332.16506@litwin.com> Organization: Clemson University Lines: 18 From article <1991May30.204332.16506@litwin.com>, by vlr@litwin.com (Vic Rice): > 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 Our compiler (Fortran for RISC version 2.0 I think) has a barely documented option that will trap any NaN's and generate an illegal instruction error. It also sets all variables to NaN at the beginning of execution (rather than setting them to zero) so it will test for unassigned variable usage (e.g. misspelled variable names). Try f77 -trapuv Hope this helps. Larry Brown