numeric_limits::max_exponent10
傳回浮點型別可以表示為限制值的最大正值整數的指數,當十進位引發該電源時。
static const int max_exponent10 = 0;
傳回值
最大的整數 Base 10 指數能由型別。
備註
成員函式會傳回浮點型別才有意義。 max_exponent 是型別的 float值 FLT_MAX_10。
範例
// numeric_limits_max_exponent10.cpp
// compile with: /EHsc
#include <iostream>
#include <limits>
using namespace std;
int main( )
{
cout << "The maximum base 10 exponent for type float is: "
<< numeric_limits<float>::max_exponent10
<< endl;
cout << "The maximum base 10 exponent for type double is: "
<< numeric_limits<double>::max_exponent10
<< endl;
cout << "The maximum base 10 exponent for type long double is: "
<< numeric_limits<long double>::max_exponent10
<< endl;
}
需求
標題: <limits>
命名空間: std