std::numeric_limits<T>:: is_exact
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Basic types | |||||||||||||||||||||
| Fixed width integer types (C++11) | |||||||||||||||||||||
| Fixed width floating-point types (C++23) | |||||||||||||||||||||
|
|||||||||||||||||||||
| Numeric limits | |||||||||||||||||||||
| C numeric limits interface | |||||||||||||||||||||
| Runtime type information | |||||||||||||||||||||
|
|||||||||||||||||||||
| Static constants | ||||
|
numeric_limits::is_exact
|
||||
|
(C++11)
|
||||
| Static member functions | ||||
|
(C++11)
|
||||
| Helper types | ||||
|
static
const
bool
is_exact
;
|
(C++11 前) | |
|
static
constexpr
bool
is_exact
;
|
(C++11 起) | |
对于所有使用精确表示的算术类型
T
,
std::
numeric_limits
<
T
>
::
is_exact
的值为
true
。
标准特化
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]
|
标识表示有限值集合的类型
(公开静态成员常量) |