diff options
-rw-r--r-- | host/include/uhd/utils/fp_compare_delta.ipp | 6 | ||||
-rw-r--r-- | host/include/uhd/utils/fp_compare_epsilon.ipp | 12 | ||||
-rw-r--r-- | host/lib/usrp/gpsd_iface.cpp | 10 | ||||
-rw-r--r-- | host/lib/usrp/x300/x300_dboard_iface.cpp | 2 |
4 files changed, 15 insertions, 15 deletions
diff --git a/host/include/uhd/utils/fp_compare_delta.ipp b/host/include/uhd/utils/fp_compare_delta.ipp index 95288c3ba..a9734c8c1 100644 --- a/host/include/uhd/utils/fp_compare_delta.ipp +++ b/host/include/uhd/utils/fp_compare_delta.ipp @@ -58,7 +58,7 @@ namespace uhd { namespace math { namespace fp_compare { template<typename float_t> UHD_INLINE bool operator==(fp_compare_delta<float_t> lhs, fp_compare_delta<float_t> rhs) { float_t delta = fp_compare_select_delta(lhs._delta, rhs._delta); - return (std::fabs(lhs._value - rhs._value) < delta); + return (std::abs(lhs._value - rhs._value) < delta); } template<typename float_t> UHD_INLINE @@ -92,7 +92,7 @@ namespace uhd { namespace math { namespace fp_compare { bool operator==(fp_compare_delta<float_t> lhs, double rhs) { float_t delta = float_t(fp_compare_select_delta(double(lhs._delta), DOUBLE_PRECISION_DELTA)); - return (std::fabs(lhs._value - rhs) < delta); + return (std::abs(lhs._value - rhs) < delta); } template<typename float_t> UHD_INLINE @@ -128,7 +128,7 @@ namespace uhd { namespace math { namespace fp_compare { bool operator==(double lhs, fp_compare_delta<float_t> rhs) { float_t delta = fp_compare_select_delta(DOUBLE_PRECISION_DELTA, double(rhs._delta)); - return (std::fabs(lhs - rhs._value) < delta); + return (std::abs(lhs - rhs._value) < delta); } template<typename float_t> UHD_INLINE diff --git a/host/include/uhd/utils/fp_compare_epsilon.ipp b/host/include/uhd/utils/fp_compare_epsilon.ipp index 0fa98de09..bbd702512 100644 --- a/host/include/uhd/utils/fp_compare_epsilon.ipp +++ b/host/include/uhd/utils/fp_compare_epsilon.ipp @@ -53,9 +53,9 @@ namespace uhd { namespace math { namespace fp_compare { template<typename float_t> UHD_INLINE bool operator==(fp_compare_epsilon<float_t> lhs, fp_compare_epsilon<float_t> rhs) { - bool lhs_compare = ((std::fabs(lhs._value - rhs._value) / std::fabs(lhs._value)) + bool lhs_compare = ((std::abs(lhs._value - rhs._value) / std::abs(lhs._value)) <= lhs._epsilon); - bool rhs_compare = ((std::fabs(lhs._value - rhs._value) / std::fabs(rhs._value)) + bool rhs_compare = ((std::abs(lhs._value - rhs._value) / std::abs(rhs._value)) <= rhs._epsilon); return (lhs_compare && rhs_compare); @@ -89,9 +89,9 @@ namespace uhd { namespace math { namespace fp_compare { template<typename float_t> UHD_INLINE bool operator==(fp_compare_epsilon<float_t> lhs, double rhs) { - bool lhs_compare = ((std::fabs(lhs._value - rhs) / std::fabs(lhs._value)) + bool lhs_compare = ((std::abs(lhs._value - rhs) / std::abs(lhs._value)) <= lhs._epsilon); - bool rhs_compare = ((std::fabs(lhs._value - rhs) / std::fabs(rhs)) + bool rhs_compare = ((std::abs(lhs._value - rhs) / std::abs(rhs)) <= DOUBLE_PRECISION_EPSILON); return (lhs_compare && rhs_compare); @@ -127,9 +127,9 @@ namespace uhd { namespace math { namespace fp_compare { template<typename float_t> UHD_INLINE bool operator==(double lhs, fp_compare_epsilon<float_t> rhs) { - bool lhs_compare = ((std::fabs(lhs - rhs._value) / std::fabs(lhs)) + bool lhs_compare = ((std::abs(lhs - rhs._value) / std::abs(lhs)) <= DOUBLE_PRECISION_EPSILON); - bool rhs_compare = ((std::fabs(lhs - rhs._value) / std::fabs(rhs._value)) + bool rhs_compare = ((std::abs(lhs - rhs._value) / std::abs(rhs._value)) <= rhs._epsilon); return (lhs_compare && rhs_compare); diff --git a/host/lib/usrp/gpsd_iface.cpp b/host/lib/usrp/gpsd_iface.cpp index b34132fa0..1858a6a24 100644 --- a/host/lib/usrp/gpsd_iface.cpp +++ b/host/lib/usrp/gpsd_iface.cpp @@ -210,9 +210,9 @@ private: // member functions % tm.tm_min % tm.tm_sec % (_gps_data.status ? 'A' : 'V') - % _zeroize(_deg_to_dm(std::fabs(_gps_data.fix.latitude))) + % _zeroize(_deg_to_dm(std::abs(_gps_data.fix.latitude))) % ((_gps_data.fix.latitude > 0) ? 'N' : 'S') - % _zeroize(_deg_to_dm(std::fabs(_gps_data.fix.longitude))) + % _zeroize(_deg_to_dm(std::abs(_gps_data.fix.longitude))) % ((_gps_data.fix.longitude > 0) ? 'E' : 'W') % _zeroize(_gps_data.fix.speed * MPS_TO_KNOTS) % _zeroize(_gps_data.fix.track) @@ -242,9 +242,9 @@ private: // member functions % tm.tm_hour % tm.tm_min % tm.tm_sec - % _deg_to_dm(std::fabs(_gps_data.fix.latitude)) + % _deg_to_dm(std::abs(_gps_data.fix.latitude)) % ((_gps_data.fix.latitude > 0) ? 'N' : 'S') - % _deg_to_dm(std::fabs(_gps_data.fix.longitude)) + % _deg_to_dm(std::abs(_gps_data.fix.longitude)) % ((_gps_data.fix.longitude > 0) ? 'E' : 'W') % _gps_data.status % _gps_data.satellites_used); @@ -271,7 +271,7 @@ private: // member functions string.append(","); else { string.append( - str(boost::format("%3.2f,%s") % std::fabs(mag_var) + str(boost::format("%3.2f,%s") % std::abs(mag_var) % (mag_var > 0 ? "E" : "W"))); } diff --git a/host/lib/usrp/x300/x300_dboard_iface.cpp b/host/lib/usrp/x300/x300_dboard_iface.cpp index 3fc5921c6..6986ee8ab 100644 --- a/host/lib/usrp/x300/x300_dboard_iface.cpp +++ b/host/lib/usrp/x300/x300_dboard_iface.cpp @@ -56,7 +56,7 @@ void x300_dboard_iface::set_clock_rate(unit_t unit, double rate) if (unit == UNIT_BOTH) throw uhd::runtime_error("UNIT_BOTH not supported."); // Just return if the requested rate is already set - if (std::fabs(_clock_rates[unit] - rate) < std::numeric_limits<double>::epsilon()) + if (std::abs(_clock_rates[unit] - rate) < std::numeric_limits<double>::epsilon()) return; switch(unit) |