- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
In the fortran, how to detect "NaN", "....", "???" apearing for a real variable and to stop the running of the code immediately after detecting it?
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If you want to test in code for a NaN, use the intrinsic function ISNAN. (This is an extension - a future version will support the F2003 standard routine for this purpose.)
If you want the program to stop automatically when a NaN is seen, then change the Floating Point Exception behavior to /fpe:0.
If you want the program to stop automatically when a NaN is seen, then change the Floating Point Exception behavior to /fpe:0.

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