在线文档教程
C++
应用 | Utilities

std::float_round_style

STD:浮动[医]圆[医]风格

Defined in header
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当表达式的结果存储在浮点类型的对象中时,指示浮点算法使用的舍入样式。这些价值是:

枚举常数

NameDefinition
std::round_indeterminateRounding style cannot be determined
std::round_toward_zeroRounding toward zero
std::round_to_nearestRounding toward nearest representable value
std::round_toward_infinityRounding toward positive infinity
std::round_toward_neg_infinityRounding toward negative infinity

另见

round_style staticidentifies the rounding style used by the type (public static member constant)
FE_DOWNWARDFE_TONEARESTFE_TOWARDZEROFE_UPWARD (C++11)floating-point rounding direction (macro constant)

© cppreference.com

在CreativeCommonsAttribution下授权-ShareAlike未移植许可v3.0。

http://en.cppreference.com/w/cpp/type/NUMERIC[医]限制/浮动[医]圆[医]风格