- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
In my code there are several palces producing Nan. For some reason, I want to trap only one of them which is in a specific module, not the other ones. What I tried and did not work is,
1) When I activate the -fpe0 option the programme stops at the first Nan which is not the one I want to trap.
2) I compiled only the module of interest with the -fpe0 option. This did not work either.
3) I used IFCORE module and the FOR_SET_FPE option only in the module of ineterst. However, this is also catching all the Nan all over the entire programme.
How can I trap the Nans only in a specific module/subroutine?
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If you know what variable(s) you are looking at you can call the function IEEE_IS_NAN (x), an then do something based on a TRUE result such as output some data or set a debugger breakpoint....
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am aware of isnan function, but this is not a problem that can be solved with this approach (Huge iterative code, hard to trace a Nan with debugger ...etc). I need a method defined in my first post. Thank you anyway.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Use /fpe-all:0 on the routine where you want to trap. /fpe (without -all) affects the main program only,

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