Namespaces
Variants

std::numeric_limits<T>::round_error

来自 zh.cppreference.net
 
 
 
类型支持
基本类型
定宽整数类型 (C++11)
定宽浮点数类型 (C++23)
(C++11)    
(C++17)
数值极限
C 数值极限接口
运行时类型信息
 
 
static T round_error() throw();
(C++11 前)
static constexpr T round_error() noexcept;
(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

参阅

[static]
标识该类型使用的舍入样式
(公开静态成员常量)