Namespaces
Variants
Views
Actions

std::float_round_style

From cppreference.com
 
 
Utilities library
Language support
Type support (basic types, RTTI)
Library feature-test macros (C++20)
Dynamic memory management
Program utilities
Coroutine support (C++20)
Variadic functions
Debugging support
(C++26)
Three-way comparison
(C++20)
(C++20)(C++20)(C++20)
(C++20)(C++20)(C++20)
General utilities
Date and time
Function objects
Formatting library (C++20)
(C++11)
Relational operators (deprecated in C++20)
Integer comparison functions
(C++20)(C++20)(C++20)   
(C++20)
Swap and type operations
(C++14)
(C++11)
(C++11)
(C++11)
(C++17)
Common vocabulary types
(C++11)
(C++17)
(C++17)
(C++17)
(C++11)
(C++17)
(C++23)
Elementary string conversions
(C++17)
(C++17)

 
 
 
Defined in header <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

};

Enumeration constants of type std::float_round_style indicate the rounding style used by floating-point arithmetic whenever a result of an expression is stored in an object of a floating-point type. The values are:

[edit] Enumeration constants

Name Definition
std::round_indeterminate Rounding style cannot be determined
std::round_toward_zero Rounding toward zero
std::round_to_nearest Rounding toward nearest representable value
std::round_toward_infinity Rounding toward positive infinity
std::round_toward_neg_infinity Rounding toward negative infinity

[edit] See also

[static]
identifies the rounding style used by the type
(public static member constant) [edit]
floating-point rounding direction
(macro constant) [edit]