Namespaces
Variants

std::numeric_limits<T>:: has_signaling_NaN

From cppreference.net
Utilities library
static const bool has_signaling_NaN ;
(C++11 前)
static constexpr bool has_signaling_NaN ;
(C++11 起)

对于所有能够表示特殊值"信令 非数值 "的类型 T std:: numeric_limits < T > :: has_signaling_NaN 的值为 true 。该常量对所有浮点类型均有意义,且当 std:: numeric_limits < T > :: is_iec559 == true 时保证为 true

标准特化

T std:: numeric_limits < T > :: has_signaling_NaN 的值
/* non-specialized */ false
bool false
char false
signed char false
unsigned char false
wchar_t false
char8_t (自 C++20 起) false
char16_t (自 C++11 起) false
char32_t (自 C++11 起) false
short false
unsigned short false
int false
unsigned int false
long false
unsigned long false
long long (自 C++11 起) false
unsigned long long (自 C++11 起) false
float 通常为 true
double 通常为 true
long double 通常为 true

参见

[static]
返回给定浮点类型的静默非数值
(公开静态成员函数)
标识可表示特殊值“正无穷大”的浮点类型
(公开静态成员常量)
标识可表示特殊值“静默非数值”的浮点类型
(公开静态成员常量)