std::numeric_limits<T>::has_signaling_NaN
来自 cppreference.cn
static const bool has_signaling_NaN; |
(C++11 前) | |
static constexpr bool has_signaling_NaN; |
(C++11 起) | |
std::numeric_limits<T>::has_signaling_NaN 的值对于所有能够表示特殊值“信令 非数字 (Not-A-Number)”的类型 T
来说都是 true。此常量对所有浮点类型都有意义,并且如果 std::numeric_limits<T>::is_iec559 == true,则保证为 true。
[编辑] 标准特化
T
|
std::numeric_limits<T>::has_signaling_NaN 的值 |
/* 未特化 */ | 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 |
[编辑] 参阅
[静态] |
返回给定浮点类型的安静 NaN 值 (public static 成员函数) |
[静态] |
确定可以表示特殊值“正无穷”的浮点类型 (public static 成员常量) |
[静态] |
确定可以表示特殊值“安静的非数”(quiet not-a-number,NaN)的浮点类型 (public static 成员常量) |