float_round_style
枚举描述实现可以为舍入浮点值选择为整数值的各种方法。
enum float_round_style {
round_indeterminate = -1,
round_toward_zero = 0,
round_to_nearest = 1,
round_toward_infinity = 2,
round_toward_neg_infinity = 3
};
返回值
枚举返回:
round_indeterminate,如果该轮的方法无法确定的。
round_toward_zero,如果在零舍入。
round_to_nearest,如果被舍入到新的整数。
round_toward_infinity,如果远离零的舍入。
round_toward_neg_infinity,如果被舍入到更负的整数。
示例
为该枚举的值可以捕获的示例参见 numeric_limits::round_style。
要求
标头: <limits>
命名空间: std