std::numeri...min_exponent(3)
π NAME π
std::numeric_limits::min_exponent β std::numeric_limits::min_exponent
hiii bestie, welcome to the std::numeri...min_exponent(3) page from the C++ Standard Libary manual. Yes, the name section is literally the same thing twice β iconic symmetry, no notes π
.
πΈ Synopsis πΈ
static const int min_exponent; (until C++11)
static constexpr int min_exponent; (since C++11)
okay so the tea is: the value of std::numeric_limits<T>::min_exponent is the lowest negative number n such that r^(n-1) β yep, r to the n-1, also shown as rn-1 in the flattened text β where r is std::numeric_limits<T>::radix, is a valid normalized value of the floating-point type T. That's the whole vibe β¨.
π Standard specializations π
here's the whole squad, bestie β for each T, this is the value of std::numeric_limits<T>::min_exponent:
/* non-specialized */β0boolβ0charβ0signed charβ0unsigned charβ0wchar_tβ0char8_t(since C++20) β0char16_t(since C++11) β0char32_t(since C++11) β0shortβ0unsigned shortβ0intβ0unsigned intβ0longβ0unsigned longβ0long long(since C++11) β0unsigned long long(since C++11) β0floatβFLT_MIN_EXPdoubleβDBL_MIN_EXPlong doubleβLDBL_MIN_EXP
π¦ Example π¦
This example demonstrates the relationships of min_exponent, min_exponent10, min(), and radix for the type float:
// Run this code
#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';
}
π Output π
min() = 1.17549e-38
min_exponent10 = -37
min() = 0x1p-126
min_exponent = -125
π See also π
radixβ the radix or integer base used by the representation of the given type.[static](public static member constant).min_exponent10β the smallest negative power of ten that is a valid normalized floating-point value.[static](public static member constant).max_exponentβ one more than the largest integer power of the radix that is a valid finite floating-point value.[static](public static member constant).max_exponent10β the largest integer power of 10 that is a valid finite floating-point value.[static](public static member constant).
π source: http://cppreference.com Β· version/date: 2024.06.10 β mwah π go slay those normalized floats, bestie π
π¦ where this page comes from
- nixpkgs unstable: stdman 2024.07.05
- opensuse-leap 16.0: stdman 2024.07.05-bp160.1.9 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms