- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
You should run your code in the debugger and find out where this NaN is being introduced.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page