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

要求

页眉: <限制>

命名空间: std