USRP Hardware Driver and USRP Manual  Version: 4.0.0.0-170-gd398fe465
UHD and USRP Manual
uhd::math::fp_compare::fp_compare_delta< float_t > Class Template Reference

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

Public Attributes

float_t _value
 
float_t _delta
 

Detailed Description

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

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

Constructor & Destructor Documentation

◆ fp_compare_delta() [1/5]

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

◆ fp_compare_delta() [2/5]

template<typename float_t >
UHD_INLINE uhd::math::fp_compare::fp_compare_delta< float_t >::fp_compare_delta ( float_t  value,
float_t  delta 
)

◆ fp_compare_delta() [3/5]

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

◆ ~fp_compare_delta()

template<typename float_t >
UHD_INLINE uhd::math::fp_compare::fp_compare_delta< float_t >::~fp_compare_delta ( )

◆ fp_compare_delta() [4/5]

◆ fp_compare_delta() [5/5]

template<>
UHD_INLINE uhd::math::fp_compare::fp_compare_delta< double >::fp_compare_delta ( double  value)

Member Function Documentation

◆ operator=()

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

Member Data Documentation

◆ _delta

template<typename float_t>
float_t uhd::math::fp_compare::fp_compare_delta< float_t >::_delta

◆ _value

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

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