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