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
988Просмотр.

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
Сотрудник
988Просмотр.
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.
abhimodak
Новый участник I
988Просмотр.

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

g_f_thomas
Начинающий
988Просмотр.

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

Ответить