Not Enough Math
Lightweight zero-dependency C++ math library
Loading...
Searching...
No Matches
nan.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <concepts>
4#include <limits>
5
6#include "config.hpp"
7
8namespace nem
9{
10 template <typename T>
11 concept CanBeNaN = std::floating_point<T> ||
12 (requires
13 {
14 { std::numeric_limits<T>::has_quiet_NaN } -> std::convertible_to<bool>;
15 requires std::numeric_limits<T>::has_quiet_NaN;
16 }
17 );
18
19 template<typename T>
20 concept CanBeNaNIfConfig = std::conditional_t<
22 std::bool_constant<CanBeNaN<T>>,
23 std::true_type
24 >::value;
25}
Definition config.hpp:16
constexpr bool ERR_USE_NAN
Definition config.hpp:30