aboutsummaryrefslogtreecommitdiffstats
path: root/host/include
diff options
context:
space:
mode:
Diffstat (limited to 'host/include')
-rw-r--r--host/include/uhd/rfnoc/siggen_block_control.hpp7
-rw-r--r--host/include/uhd/utils/math.hpp2
2 files changed, 5 insertions, 4 deletions
diff --git a/host/include/uhd/rfnoc/siggen_block_control.hpp b/host/include/uhd/rfnoc/siggen_block_control.hpp
index 944ecc4e0..e599659b6 100644
--- a/host/include/uhd/rfnoc/siggen_block_control.hpp
+++ b/host/include/uhd/rfnoc/siggen_block_control.hpp
@@ -6,10 +6,9 @@
#pragma once
-#define _USE_MATH_DEFINES
#include <uhd/config.hpp>
#include <uhd/rfnoc/noc_block_base.hpp>
-#include <cmath>
+#include <uhd/utils/math.hpp>
#include <complex>
namespace uhd { namespace rfnoc {
@@ -195,8 +194,8 @@ public:
if (sample_rate <= 0.0) {
throw uhd::value_error("sample_rate must be > 0.0");
}
- const double phase_inc = (frequency / sample_rate) * 2.0 * M_PI;
- if (phase_inc < -M_PI || phase_inc > M_PI) {
+ const double phase_inc = (frequency / sample_rate) * 2.0 * uhd::math::PI;
+ if (phase_inc < -uhd::math::PI || phase_inc > uhd::math::PI) {
throw uhd::value_error("frequency must be in [-samp_rate/2, samp_rate/2]");
}
set_sine_phase_increment(phase_inc, port);
diff --git a/host/include/uhd/utils/math.hpp b/host/include/uhd/utils/math.hpp
index d442d6a94..becc256f1 100644
--- a/host/include/uhd/utils/math.hpp
+++ b/host/include/uhd/utils/math.hpp
@@ -30,6 +30,8 @@ namespace uhd {
*/
namespace math {
+static const double PI = 3.14159265358979323846;
+
/*!
* Define epsilon values for floating point comparisons.
*