std::numeric_limits<T>::min_exponent_C++中文网

static const int min_exponent;

(C++11 前)

static constexpr int min_exponent;

(C++11 起)

std::numeric_limits<T>::min_exponent 的值是满足 rn-1
是浮点类型 T 合法正规值的最低负数 n ,其中 rstd::numeric_limits<T>::radix

标准特化

 
T std::numeric_limits<T>::min_exponent 的值
/* non-specialized */ 0
bool 0
char 0
signed char 0
unsigned char 0
wchar_t 0
char8_t 0
char16_t 0
char32_t 0
short 0
unsigned short 0
int 0
unsigned int 0
long 0
unsigned long 0
long long 0
unsigned long long 0
float FLT_MIN_EXP
double DBL_MIN_EXP
long double LDBL_MIN_EXP

示例

为 float 类型演示 min_exponent 、 min_exponent10 、 min 及 radix 的关系:

输出:

min() = 1.17549e-38
min_exponent10 = -37
min() = 0x1p-126
min_exponent = -125

参阅