Reference
C Library
IOstream Library
Strings library
STL Containers
STL Algorithms
Miscellaneous
Miscellaneous
complex
exception
functional
iterator
limits
locale
memory
new
numeric
stdexcept
typeinfo
utility
valarray
limits
float_denorm_style
float_round_style
numeric_limits


float_round_style

type
<limits>

Enum type for float rounding style

Enumerated type with possible rounding styles for floating types. It is the type of member round_style in the numeric_limits class template.

It is defined as:

1
2
3
4
5
6
7
enum float_round_style {
  round_indeterminate       = -1,
  round_toward_zero         = 0,
  round_to_nearest          = 1,
  round_toward_infinity     = 2,
  round_toward_neg_infinity = 3
};


With the following possible values:
labelvaluemeaning
round_intermediate-1Rounding style cannot be determined at compile time
round_toward_zero0Rounding style toward zero
round_to_nearest1Rounding style to the nearest representable value
round_toward_infinity2Rounding style toward infinity
round_toward_neg_infinity3Rounding style toward negative infinity

The default value in the non-specialized numeric_limits class for its round_style member is round_toward_zero (0).

See also