Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

FORTRAN sqrt:DOMAIN error

rhballou
Beginner
1,900 Views
I am running a program under Windows 7 with Compaq Visual Fortran version 6.6B containing a square-root function. The M6201:MATH sqrt:DOMAIN run-time error occurs. I have verified that thevalue of the variable sentto the DSQRT functionis positive and the variable is REAL*8. The QuickWin library is used. Are there other reasons besides a negative argument that can cause the error?
0 Kudos
3 Replies
Jugoslav_Dujic
Valued Contributor II
1,900 Views
A NaN (or possibly also Inf) would also trigger it, if I recall correctly.
0 Kudos
rhballou
Beginner
1,900 Views
Thanks for reply. I am not familiar with NaN. Can it be corrected or how is it treated?
0 Kudos
Jugoslav_Dujic
Valued Contributor II
1,900 Views
NaN comes as result of floating-point operation which has undefined result. The most common case is 0./0., and there are other possibilities, such as Inf/Inf, Inf*0., etc.

Why don't you run your program through debugger, and find out for yourself?
0 Kudos
Reply