std::numeric_limits<T>:: max_exponent10
|
static
const
int
max_exponent10
;
|
(C++11 이전) | |
|
static
constexpr
int
max_exponent10
;
|
(C++11 이후) | |
std::
numeric_limits
<
T
>
::
max_exponent10
의 값은 부동 소수점 타입
T
의 유한한 표현 가능 값인
10
n
이 될 수 있는 가장 큰 양의 정수
n
입니다.
표준 특수화
T
|
std:: numeric_limits < T > :: max_exponent10 의 값 |
| /* non-specialized */ | 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_MAX_10_EXP |
| double | DBL_MAX_10_EXP |
| long double | LDBL_MAX_10_EXP |
예제
float
타입에 대한
max_exponent
,
max_exponent10
, 그리고
max()
의 관계를 보여줍니다:
#include <iostream> #include <limits> int main() { std::cout << "max() = " << std::numeric_limits<float>::max() << '\n' << "max_exponent10 = " << std::numeric_limits<float>::max_exponent10 << '\n' << std::hexfloat << '\n' << "max() = " << std::numeric_limits<float>::max() << '\n' << "max_exponent = " << std::numeric_limits<float>::max_exponent << '\n'; }
출력:
max() = 3.40282e+38 max_exponent10 = 38 max() = 0x1.fffffep+127 max_exponent = 128
참고 항목
|
[static]
|
유효한 유한 부동소수점 값인 기수의 가장 큰 정수 거듭제곱보다 1 큰 값
(public static member constant) |
|
[static]
|
유효한 정규화된 부동소수점 값인 기수의 가장 작은 음의 거듭제곱보다 1 큰 값
(public static member constant) |
|
[static]
|
유효한 정규화된 부동소수점 값인 10의 가장 작은 음의 거듭제곱
(public static member constant) |