在线文档教程
C++
应用 | Utilities

std::numeric_limits::radix

STD::数字[医]限:

static const int radix;(until C++11)
static constexpr int radix;(since C++11)

价值std::numeric_limits<T>::radix用于表示类型的数字系统的基础。对于所有二进制数字类型,它是2,但例如,对于ieee 754,它可能是10。十进制浮点类型或者为第三方二进制编码十进制整数。这个常量对于所有的专门化都是有意义的。

标准专业化

Tvalue of std::numeric_limits::radix
/* non-specialized */​0​
bool2
char2
signed char2
unsigned char2
wchar_t2
char16_t2
char32_t2
short2
unsigned short2
int2
unsigned int2
long2
unsigned long2
long long2
unsigned long long2
floatFLT_RADIX
doubleFLT_RADIX
long doubleFLT_RADIX

另见

digits staticnumber of radix digits that can be represented without change (public static member constant)
min_exponent staticone more than the smallest negative power of the radix that is a valid normalized floating-point value (public static member constant)
max_exponent staticone more than the largest integer power of the radix that is a valid finite floating-point value (public static member constant)

© cppreference.com

在CreativeCommonsAttribution下授权-ShareAlike未移植许可v3.0。

http://en.cppreference.com/w/cpp/type/NUMERIC[医]极限/基数