std::numeric_limits<T>::radix
来自 cppreference.cn
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 的值 |
/* 未特化 */ | 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 数字位数(public static member constant) |
[静态] |
比最小负数基幂大一,该基幂是有效的正规化浮点值 (public static member constant) |
[静态] |
比最大整数基幂大一,该基幂是有效的有限浮点值 (public static member constant) |