# Function to detect NaN values

**URL:** <https://fortran-lang.discourse.group/t/function-to-detect-nan-values/7845>\
**Category:** Uncategorized\
**Created:** [April 15, 2024, 4:13pm UTC](https://fortran-lang.discourse.group/t/function-to-detect-nan-values/7845 "2024-04-15T16:13:08Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![hkvzjal](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/hkvzjal/32/3055_2.png) [@hkvzjal](https://fortran-lang.discourse.group/u/hkvzjal)\
**Post date:** [April 15, 2024, 4:16pm UTC](https://fortran-lang.discourse.group/t/function-to-detect-nan-values/7845/2 "2024-04-15T16:16:53Z")

</div>

Depending on your needs you can rely on the ieee\_arithmetic module [ieee\_arithmetic in Fortran Wiki](https://fortranwiki.org/fortran/show/ieee_arithmetic) which already has a function for that, or you could have a read to this thread: [Challenge: Testing Inf and NaN with `gfortran-13 -Ofast`](https://fortran-lang.discourse.group/t/challenge-testing-inf-and-nan-with-gfortran-13-ofast/6481) for some ideas

---

_[View the full topic](https://fortran-lang.discourse.group/t/function-to-detect-nan-values/7845)._
