|
template<typename T , ARM_COMPUTE_REQUIRES_TA(traits::is_floating_point< T >::value) > |
T | round_to_zero (T value) |
| Round floating-point value with round to zero. More...
|
|
template<typename T , ARM_COMPUTE_REQUIRES_TA(traits::is_floating_point< T >::value) > |
T | round_away_from_zero (T value) |
| Round floating-point value with round away from zero. More...
|
|
template<typename T , ARM_COMPUTE_REQUIRES_TA(traits::is_floating_point< T >::value) > |
T | round_half_to_zero (T value) |
| Round floating-point value with half value rounding towards zero. More...
|
|
template<typename T , ARM_COMPUTE_REQUIRES_TA(traits::is_floating_point< T >::value) > |
T | round_half_away_from_zero (T value) |
| Round floating-point value with half value rounding away from zero. More...
|
|
template<typename T , ARM_COMPUTE_REQUIRES_TA(traits::is_floating_point< T >::value) > |
T | round_half_up (T value) |
| Round floating-point value with half value rounding to positive infinity. More...
|
|
template<typename T , ARM_COMPUTE_REQUIRES_TA(traits::is_floating_point< T >::value) > |
T | round_half_down (T value) |
| Round floating-point value with half value rounding to negative infinity. More...
|
|
template<typename T , ARM_COMPUTE_REQUIRES_TA(traits::is_floating_point< T >::value) > |
T | round_half_even (T value, T epsilon=std::numeric_limits< T >::epsilon()) |
| Round floating-point value with half value rounding to nearest even. More...
|
|
template<typename T , ARM_COMPUTE_REQUIRES_TA(traits::is_floating_point< T >::value) > |
T | round (T value, RoundingMode rounding_mode) |
| Round floating-point value given a rounding mode. More...
|
|
T arm_compute::utils::rounding::round |
( |
T |
value, |
|
|
RoundingMode |
rounding_mode |
|
) |
| |
|
inline |
Round floating-point value given a rounding mode.
- Template Parameters
-
T | Parameter type. Should be of floating point type. |
- Parameters
-
[in] | value | floating-point value to be rounded. |
[in] | rounding_mode | Rounding mode to use. |
- Returns
- Floating-point value of rounded
value
.
Definition at line 181 of file Rounding.h.
183 switch (rounding_mode)
185 case RoundingMode::TO_ZERO:
187 case RoundingMode::AWAY_FROM_ZERO:
189 case RoundingMode::HALF_TO_ZERO:
191 case RoundingMode::HALF_AWAY_FROM_ZERO:
193 case RoundingMode::HALF_UP:
195 case RoundingMode::HALF_DOWN:
197 case RoundingMode::HALF_EVEN:
References ARM_COMPUTE_ERROR, AWAY_FROM_ZERO, HALF_AWAY_FROM_ZERO, HALF_DOWN, HALF_EVEN, HALF_TO_ZERO, HALF_UP, round_away_from_zero(), round_half_away_from_zero(), round_half_down(), round_half_even(), round_half_to_zero(), round_half_up(), round_to_zero(), and TO_ZERO.