22static const double PI = 3.14159265358979323846;
40static const float SINGLE_PRECISION_EPSILON = 1.19e-7f;
41static const double DOUBLE_PRECISION_EPSILON = 2.22e-16;
52static constexpr double FREQ_COMPARE_EPSILON = 1e-12;
69template <
typename float_t>
98template <
typename float_t>
101template <
typename float_t>
104template <
typename float_t>
107template <
typename float_t>
110template <
typename float_t>
113template <
typename float_t>
119template <
typename float_t>
121template <
typename float_t>
123template <
typename float_t>
125template <
typename float_t>
127template <
typename float_t>
129template <
typename float_t>
132template <
typename float_t>
134template <
typename float_t>
136template <
typename float_t>
138template <
typename float_t>
140template <
typename float_t>
142template <
typename float_t>
170static const float SINGLE_PRECISION_DELTA = 1e-3f;
171static const double DOUBLE_PRECISION_DELTA = 1e-5;
174static const double FREQ_COMPARISON_DELTA_HZ = 0.1;
177namespace fp_compare {
192template <
typename float_t>
206template <
typename float_t>
208template <
typename float_t>
210template <
typename float_t>
212template <
typename float_t>
214template <
typename float_t>
216template <
typename float_t>
221template <
typename float_t>
223template <
typename float_t>
225template <
typename float_t>
227template <
typename float_t>
229template <
typename float_t>
231template <
typename float_t>
234template <
typename float_t>
236template <
typename float_t>
238template <
typename float_t>
240template <
typename float_t>
242template <
typename float_t>
244template <
typename float_t>
257 return std::pow(10, (dB_val) / 10.0);
262 return 10 * std::log10(val);
279 return (T(0) < x) - (x < T(0));
295 double freq = std::fmod(requested_freq, rate);
296 if (std::abs(freq) > rate / 2.0)
UHD_INLINE fp_compare_delta(float_t value)
float_t _delta
Definition math.hpp:203
UHD_INLINE void operator=(const fp_compare_delta ©)
Definition fp_compare_delta.ipp:56
float_t _value
Definition math.hpp:202
float_t _epsilon
Definition math.hpp:80
UHD_INLINE void operator=(const fp_compare_epsilon ©)
Definition fp_compare_epsilon.ipp:51
float_t _value
Definition math.hpp:79
UHD_INLINE fp_compare_epsilon(float_t value)
UHD_INLINE fp_compare_epsilon(float value)
Definition fp_compare_epsilon.ipp:19
UHD_INLINE freq_compare_epsilon(const freq_compare_epsilon ©)
Definition math.hpp:154
UHD_INLINE freq_compare_epsilon(double value)
Definition math.hpp:149
#define UHD_INLINE
Definition config.h:65
Definition fp_compare_delta.ipp:15
UHD_INLINE bool operator!=(fp_compare_delta< float_t > lhs, fp_compare_delta< float_t > rhs)
Definition fp_compare_delta.ipp:71
UHD_INLINE bool operator<=(fp_compare_delta< float_t > lhs, fp_compare_delta< float_t > rhs)
Definition fp_compare_delta.ipp:84
UHD_INLINE bool operator==(fp_compare_delta< float_t > lhs, fp_compare_delta< float_t > rhs)
Definition fp_compare_delta.ipp:64
UHD_INLINE bool operator<(fp_compare_delta< float_t > lhs, fp_compare_delta< float_t > rhs)
Definition fp_compare_delta.ipp:77
UHD_INLINE bool operator>(fp_compare_delta< float_t > lhs, fp_compare_delta< float_t > rhs)
Definition fp_compare_delta.ipp:90
UHD_INLINE bool operator>=(fp_compare_delta< float_t > lhs, fp_compare_delta< float_t > rhs)
Definition fp_compare_delta.ipp:97
Definition fp_compare_delta.ipp:15
UHD_INLINE bool frequencies_are_equal(double lhs, double rhs)
Definition math.hpp:249
double dB_to_lin(const double dB_val)
Definition math.hpp:255
constexpr int sign(T x)
Returns the sign of x.
Definition math.hpp:275
double lin_to_dB(const double val)
Definition math.hpp:260
double wrap_frequency(const double requested_freq, const double rate)
Return a wrapped frequency that is the equivalent frequency in the first Nyquist zone.
Definition math.hpp:293
Definition build_info.hpp:12