- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Does anyone know of a function that will somehow tell you whether or not a variable has a finite value? I am trying to reprogram some old C code into Fortran, and I am having trouble finding a corollary for the C function "finite()".
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
FP_CLASS
ISNAN
ISNAN
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
In case your search engine is truly broken, here's another example of what you should have found:
http://objectmix.com/fortran/250300-detect-inf-nan-2.html
Or, if you don't have a browser, your Fortran textbook should describe ieee_is_finite, although it is not generally furnished with compilers without a fairly complete ieee_arithmetic module.
http://objectmix.com/fortran/250300-detect-inf-nan-2.html
Or, if you don't have a browser, your Fortran textbook should describe ieee_is_finite, although it is not generally furnished with compilers without a fairly complete ieee_arithmetic module.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
... which ours is not - yet. I would also recommend against doing things such as x=x to detect NaNs, as the compiler may optimize that away unless you use /fp:strict.

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