std::numeric_limits<T>::has_quiet_NaN
来自 cppreference.cn
static const bool has_quiet_NaN; |
(C++11 前) | |
| static constexpr bool has_quiet_NaN; |
(C++11 起) | |
std::numeric_limits<T>::has_quiet_NaN 的值为 true ,对于所有能够表示特殊值“安静 非数字 (Not-A-Number)”的类型 T。此常数对于所有浮点类型都有意义,并且如果 std::numeric_limits<T>::is_iec559 == true,则保证为 true。
[编辑] 标准特化
T
|
std::numeric_limits<T>::has_quiet_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 member function) |
| [静态] |
确定可以表示特殊值“正无穷”的浮点类型 (public static member constant) |
| 确定可以表示特殊值“发信的非数”(signaling not-a-number,NaN)的浮点类型 (public static member constant) |