Namespaces
Variants

std:: float_round_style

From cppreference.net
Utilities library
定义于头文件 <limits>
enum float_round_style {

round_indeterminate = - 1 ,
round_toward_zero = 0 ,
round_to_nearest = 1 ,
round_toward_infinity = 2 ,
round_toward_neg_infinity = 3

} ;

类型为 std::float_round_style 的枚举常量指示浮点运算所使用的舍入方式,该方式在表达式结果存储至浮点类型对象时生效。

枚举常量

枚举值 含义
std::round_indeterminate 无法确定舍入方式
std::round_toward_zero 向零舍入
std::round_to_nearest 向最接近的可表示值舍入
std::round_toward_infinity 向正无穷舍入
std::round_toward_neg_infinity 向负无穷舍入

参见

[static]
标识该类型使用的舍入风格
(公开静态成员常量)
浮点数舍入方向
(宏常量)