std::numeric_limits<T>::radix
来自 cppreference.cn
< cpp | types | numeric limits
static const int radix; |
(until C++11) | |
static constexpr int radix; |
(since C++11) | |
std::numeric_limits<T>::radix 的值是类型表示中使用的数字系统的基数。对于所有二进制数值类型,它是 2,但例如,对于 IEEE 754 decimal floating-point types 或第三方 binary-coded decimal 整数,它可能是 10。此常量对于所有特化均有意义。
[编辑] 标准特化
T
|
std::numeric_limits<T>::radix 的值 |
/* 非特化 */ | 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 |
[编辑] 参见
[静态] |
可以无损表示的 radix 数字位数(公共静态成员常量) |
[静态] |
比基数的最小负幂大一,该幂是有效的归一化浮点值 (公共静态成员常量) |
[静态] |
比基数的最大整数幂大一,该幂是有效的有限浮点值 (公共静态成员常量) |