std::numeric_limits<T>::round_error
来自cppreference.com
| (C++11 前) | ||
| |
(C++11 起) | |
返回以 ULP(末位单位)表示的最大可能舍入误差,它由 ISO 10967 定义,可以从 0.5(舍入到最近位)到 1.0(舍入到零或无穷大)之间取值。它只有在 std::numeric_limits<T>::is_integer == false 时才有意义。
返回值
T
|
std::numeric_limits<T>::round_error()
|
/* 未特化 */
|
T()
|
bool
|
false
|
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
|
0.5F
|
double
|
0.5
|
long double
|
0.5L
|
