View Full Version : NaN in numeric output field
R. T. (Fortran Man)
08-11-2003, 09:13 PM
My program appears to compile and link without error. It also runs with no error messages. However, the output does contain errors that are perplexing. About half of the numeric data fields, contain a repeating "-NaN ", or a "NaN" character in them. What is causing this strange output?
Lahey Support
08-11-2003, 11:02 PM
NaN's are IEEE values that occur when an undefined mathematical operation is attempted, like dividing zero by zero, or trying to take the logarithm of a negative number. The IEEE has devised a standard for what should happen when these sorts of situations arise. By default, LF95 will use the IEEE standard error handling, which is to assign the value NaN (stands for Not a Number), and silently continue processing. In order to find out where this is occurring, try compiling your program with the "-trap diou" option, and when the undefined operation is attempted, the program should halt, and tell you the program unit and line number where the undefined operation is being attempted.
vBulletin® v3.6.8, Copyright ©2000-2012, Jelsoft Enterprises Ltd.