18 #ifndef INCLUDED_UHD_UTILS_MATH_HPP
19 #define INCLUDED_UHD_UTILS_MATH_HPP
22 #include <boost/cstdint.hpp>
23 #include <boost/numeric/conversion/bounds.hpp>
44 static const boost::int32_t BOOST_INT32_MAX = boost::numeric::bounds<boost::int32_t>::highest();
45 static const boost::int32_t BOOST_INT32_MIN = boost::numeric::bounds<boost::int32_t>::lowest();
63 static const float SINGLE_PRECISION_EPSILON = 1.19e-7f;
64 static const double DOUBLE_PRECISION_EPSILON = 2.22e-16;
66 namespace fp_compare {
128 bool operator<(fp_compare_epsilon<float_t> lhs,
double rhs);
130 bool operator<=(fp_compare_epsilon<float_t> lhs,
double rhs);
141 bool operator<(double lhs, fp_compare_epsilon<float_t> rhs);
143 bool operator<=(double lhs, fp_compare_epsilon<float_t> rhs);
158 static const float SINGLE_PRECISION_DELTA = 1e-3f;
159 static const double DOUBLE_PRECISION_DELTA = 1e-5;
162 static const double FREQ_COMPARISON_DELTA_HZ = 0.1;
165 namespace fp_compare {
212 bool operator<(fp_compare_delta<float_t> lhs,
double rhs);
214 bool operator<=(fp_compare_delta<float_t> lhs,
double rhs);
225 bool operator<(double lhs, fp_compare_delta<float_t> rhs);
227 bool operator<=(double lhs, fp_compare_delta<float_t> rhs);