std::numeric_limits<T>::min_exponent
From cppreference.com
static const int min_exponent; |
(C++11まで) | |
| static constexpr int min_exponent; |
(C++11以降) | |
std::numeric_limits<T>::min_exponentの値は、rがstd::numeric_limits<T>::radixであるとき、rn-1
が浮動小数点型Tの有効な正規化された値となるような、最小の負の数nです。
[編集] 標準特殊化
T
|
std::numeric_limits<T>::min_exponentの値 |
| /* 非特殊化 */ | 0 |
| bool | 0 |
| char | 0 |
| signed char | 0 |
| unsigned char | 0 |
| wchar_t | 0 |
| char8_t (C++20 以降) | 0 |
| char16_t (C++11 以降) | 0 |
| char32_t (C++11 以降) | 0 |
| short | 0 |
| unsigned short | 0 |
| int | 0 |
| unsigned int | 0 |
| long | 0 |
| unsigned long | 0 |
| long long (C++11 以降) | 0 |
| unsigned long long (C++11 以降) | 0 |
| float | FLT_MIN_EXP |
| double | DBL_MIN_EXP |
| long double | LDBL_MIN_EXP |
[編集] 例
型floatのmin_exponent、min_exponent10、min()、radixの関係を示します。
このコードを実行
#include <iostream> #include <limits> int main() { std::cout << "min() = " << std::numeric_limits<float>::min() << '\n' << "min_exponent10 = " << std::numeric_limits<float>::min_exponent10 << '\n' << std::hexfloat << '\n' << "min() = " << std::numeric_limits<float>::min() << '\n' << "min_exponent = " << std::numeric_limits<float>::min_exponent << '\n'; }
出力
min() = 1.17549e-38 min_exponent10 = -37 min() = 0x1p-126 min_exponent = -125
[編集] 関連項目
| [static] |
与えられた型の表現で使用される基数または整数の底 (public static member constant) |
| [static] |
有効な正規化された浮動小数点数値である10の最小の負のべき乗 (public static member constant) |
| [static] |
有効な有限の浮動小数点数値である基数の最大の整数べき乗に1を加えたもの (public static member constant) |
| [static] |
有効な有限の浮動小数点数値である10の最大の整数べき乗 (public static member constant) |