std::numeric_limits<T>:: radix
From cppreference.net
<
cpp
|
types
|
numeric limits
C++
Utilities library
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Type support
| Basic types | |||||||||||||||||||||
| Fixed width integer types (C++11) | |||||||||||||||||||||
| Fixed width floating-point types (C++23) | |||||||||||||||||||||
|
|||||||||||||||||||||
| Numeric limits | |||||||||||||||||||||
| C numeric limits interface | |||||||||||||||||||||
| Runtime type information | |||||||||||||||||||||
|
|||||||||||||||||||||
std::numeric_limits
| Static constants | ||||
|
(C++11)
|
||||
|
numeric_limits::radix
|
||||
| Static member functions | ||||
|
(C++11)
|
||||
| Helper types | ||||
|
static
const
int
radix
;
|
(C++11前) | |
|
static
constexpr
int
radix
;
|
(C++11起) | |
std:: numeric_limits < T > :: radix 的值表示该类型数值表示系统所使用的基数。对于所有二进制数值类型,该值为 2 ,但对于其他类型可能不同,例如 IEEE 754 十进制浮点类型 或第三方 二进制编码十进制 整数的基数可能为 10 。该常量对所有特化版本均具有实际意义。
标准特化
T
|
std:: numeric_limits < T > :: radix 的值 |
| /* non-specialized */ | 0 |
| bool | 2 |
| char | 2 |
| signed char | 2 |
| unsigned char | 2 |
| wchar_t | 2 |
| char8_t (自 C++20 起) | 2 |
| char16_t (自 C++11 起) | 2 |
| char32_t (自 C++11 起) | 2 |
| short | 2 |
| unsigned short | 2 |
| int | 2 |
| unsigned int | 2 |
| long | 2 |
| unsigned long | 2 |
| long long (自 C++11 起) | 2 |
| unsigned long long (自 C++11 起) | 2 |
| float | FLT_RADIX |
| double | FLT_RADIX |
| long double | FLT_RADIX |
参见
|
[static]
|
可无精度损失表示的
radix
进制位数
(公开静态成员常量) |
|
[static]
|
基数的最大负整数幂加一,该幂是有效的规范化浮点值
(公开静态成员常量) |
|
[static]
|
基数的最大正整数幂加一,该幂是有效的有限浮点值
(公开静态成员常量) |