cMHN 1.2
C++ library for learning MHNs with pRC
Loading...
Searching...
No Matches
is_nan.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: BSD-2-Clause
2
3#ifndef pRC_CORE_VALUE_FUNCTIONS_IS_NAN_H
4#define pRC_CORE_VALUE_FUNCTIONS_IS_NAN_H
5
6#include <cmath>
7
9
10namespace pRC
11{
12 template<IsFloat T>
13 static inline constexpr auto isNaN([[maybe_unused]] T const &a)
14 {
15#if !defined(__FINITE_MATH_ONLY__) || __FINITE_MATH_ONLY__ == 0
16 using std::isnan;
17 return isnan(a());
18#else
19 return false;
20#endif // ! __FINITE_MATH_ONLY__
21 }
22
23 template<IsInteger T>
24 static inline constexpr auto isNaN(T const &)
25 {
26 return false;
27 }
28}
29#endif // pRC_CORE_VALUE_FUNCTIONS_IS_NAN_H
Definition value.hpp:12
Definition cholesky.hpp:10
static constexpr auto isNaN(T const &a)
Definition is_nan.hpp:13
static constexpr auto isnan(BFloat16 const a)
Definition bfloat16.hpp:147