USRP Hardware Driver and USRP Manual Version: 4.1.0.1
UHD and USRP Manual
uhd::math::fp_compare::fp_compare_epsilon< float_t > Class Template Reference

#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 > &copy)
 
UHD_INLINE ~fp_compare_epsilon ()
 
UHD_INLINE void operator= (const fp_compare_epsilon &copy)
 
UHD_INLINE fp_compare_epsilon (float value)
 
UHD_INLINE fp_compare_epsilon (double value)
 

Public Attributes

float_t _value
 
float_t _epsilon
 

Detailed Description

template<typename float_t>
class uhd::math::fp_compare::fp_compare_epsilon< float_t >

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);

Constructor & Destructor Documentation

◆ fp_compare_epsilon() [1/5]

template<typename float_t >
UHD_INLINE uhd::math::fp_compare::fp_compare_epsilon< float_t >::fp_compare_epsilon ( float_t  value)

◆ fp_compare_epsilon() [2/5]

template<typename float_t >
UHD_INLINE uhd::math::fp_compare::fp_compare_epsilon< float_t >::fp_compare_epsilon ( float_t  value,
float_t  epsilon 
)

◆ fp_compare_epsilon() [3/5]

template<typename float_t >
UHD_INLINE uhd::math::fp_compare::fp_compare_epsilon< float_t >::fp_compare_epsilon ( const fp_compare_epsilon< float_t > &  copy)

◆ ~fp_compare_epsilon()

◆ fp_compare_epsilon() [4/5]

UHD_INLINE uhd::math::fp_compare::fp_compare_epsilon< float >::fp_compare_epsilon ( float  value)

◆ fp_compare_epsilon() [5/5]

UHD_INLINE uhd::math::fp_compare::fp_compare_epsilon< double >::fp_compare_epsilon ( double  value)

Member Function Documentation

◆ operator=()

template<typename float_t >
UHD_INLINE void uhd::math::fp_compare::fp_compare_epsilon< float_t >::operator= ( const fp_compare_epsilon< float_t > &  copy)

Member Data Documentation

◆ _epsilon

template<typename float_t >
float_t uhd::math::fp_compare::fp_compare_epsilon< float_t >::_epsilon

◆ _value

template<typename float_t >
float_t uhd::math::fp_compare::fp_compare_epsilon< float_t >::_value

The documentation for this class was generated from the following files: