std::float_round_style - cppreference.com

std::float_round_style

来自cppreference.com
 
 
 
 
 
在标头 <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 向负无穷大舍入

参阅