std::numeric_limits<T>::is_exact
来自 zh.cppreference.net
static const bool is_exact;
|
(C++11 前) | |
static constexpr bool is_exact;
|
(C++11 起) | |
对于使用精确表示的所有算术类型 std::numeric_limits<T>::is_exact,其值为 trueT。
标准特化
T
|
std:: numeric_limits < T > :: is_exact 的值 |
| /* non-specialized */ | false |
| bool | true |
| char | true |
| signed char | true |
| unsigned char | true |
| wchar_t | true |
| char8_t (自 C++20 起) | true |
| char16_t (自 C++11 起) | true |
| char32_t (自 C++11 起) | true |
| short | true |
| unsigned short | true |
| int | true |
| unsigned int | true |
| long | true |
| unsigned long | true |
| long long (自 C++11 起) | true |
| unsigned long long (自 C++11 起) | true |
| float | false |
| double | false |
| long double | false |
注释
虽然所有满足
std::
numeric_limits
<
T
>
::
is_exact
==
true
的基础类型
T
都是整数类型,但库可以定义非整数的精确类型,例如表示分数的有理数算术类型。
参见
|
[static]
|
标识整数类型
(公开静态成员常量) |
|
[static]
|
标识有符号类型
(公开静态成员常量) |
|
[static]
|
标识表示有限值集合的类型
(公开静态成员常量) |