#include <uhd/utils/math.hpp>
Public Member Functions | |
UHD_INLINE | fp_compare_epsilon (float_t value) |
UHD_INLINE | fp_compare_epsilon (float_t value, float_t epsilon) |
UHD_INLINE | fp_compare_epsilon (const fp_compare_epsilon< float_t > ©) |
UHD_INLINE | ~fp_compare_epsilon () |
UHD_INLINE void | operator= (const fp_compare_epsilon ©) |
UHD_INLINE | fp_compare_epsilon (float value) |
UHD_INLINE | fp_compare_epsilon (double value) |
Public Attributes | |
float_t | _value |
float_t | _epsilon |
Class for floating-point comparisons using an epsilon.
At construction, you can specify the epsilon to use for the comparisons. This class, combined with the operators under it, allow for epsilon-comparisons of floats. An example is:
// Compare floats 'x' and 'y'. bool x_equals_y = (fp_compare_epsilon<float>(x) == y);
// Compare doubles 'x' and 'y'. bool x_equals_y = (fp_compare_epsilon<double>(x) == y);
UHD_INLINE uhd::math::fp_compare::fp_compare_epsilon< float_t >::fp_compare_epsilon | ( | float_t | value | ) |
UHD_INLINE uhd::math::fp_compare::fp_compare_epsilon< float_t >::fp_compare_epsilon | ( | float_t | value, |
float_t | epsilon | ||
) |
UHD_INLINE uhd::math::fp_compare::fp_compare_epsilon< float_t >::fp_compare_epsilon | ( | const fp_compare_epsilon< float_t > & | copy | ) |
UHD_INLINE uhd::math::fp_compare::fp_compare_epsilon< float_t >::~fp_compare_epsilon |
UHD_INLINE uhd::math::fp_compare::fp_compare_epsilon< float >::fp_compare_epsilon | ( | float | value | ) |
UHD_INLINE uhd::math::fp_compare::fp_compare_epsilon< double >::fp_compare_epsilon | ( | double | value | ) |
UHD_INLINE void uhd::math::fp_compare::fp_compare_epsilon< float_t >::operator= | ( | const fp_compare_epsilon< float_t > & | copy | ) |
float_t uhd::math::fp_compare::fp_compare_epsilon< float_t >::_epsilon |
float_t uhd::math::fp_compare::fp_compare_epsilon< float_t >::_value |