std::numeric_limits<T>:: round_error
From cppreference.net
<
cpp
|
types
|
numeric limits
C++
Utilities library
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Type support
| Basic types | |||||||||||||||||||||
| Fixed width integer types (C++11) | |||||||||||||||||||||
| Fixed width floating-point types (C++23) | |||||||||||||||||||||
|
|||||||||||||||||||||
| Numeric limits | |||||||||||||||||||||
| C numeric limits interface | |||||||||||||||||||||
| Runtime type information | |||||||||||||||||||||
|
|||||||||||||||||||||
std::numeric_limits
| Static constants | ||||
|
(C++11)
|
||||
| Static member functions | ||||
|
(C++11)
|
||||
|
numeric_limits::round_error
|
||||
| Helper types | ||||
|
static
T round_error
(
)
throw
(
)
;
|
(C++11 前) | |
|
static
constexpr
T round_error
(
)
noexcept
;
|
(C++11 起) | |
返回由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 |
参见
|
[static]
|
标识该类型使用的舍入风格
(公开静态成员常量) |