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

/fpe:0 not trapping NaN

abhimodak
새로운 기여자 I
990 조회수

My Program continues to run and generates (writes) NaN to the output file. I am running in debug mode with flag /fpe:0. Any ideas?

Abhi

0 포인트
3 응답
Steven_L_Intel1
990 조회수
There are many sources of NaN that may not come frome exceptions in your code. A popular way is to read a NaN from an input file. Some math routines may return NaN without an exception.

You should run your code in the debugger and find out where this NaN is being introduced.
0 포인트
abhimodak
새로운 기여자 I
990 조회수

Hi Steve

I use the debugger extensively and was able to "see" where this particular NaN was originating. I posted it on this forum as I had seens it happening quite a few times before and have always wondered why it won't get trapped by the compiler flag.

To be precise, in this case it was the Log10 function creating problem. Is there any easy way to find out which math functions will throw an exception?

Abhi

0 포인트
g_f_thomas
초급자
990 조회수

If IVF wasn't such a laggard wrt f03's ieee support TRitcouldthis. The alternative is to use Windows SEH and it will trap and traceNaN's whatever their origins even if /fpe:3 isset.

Gerry

0 포인트
응답