summaryrefslogtreecommitdiff
path: root/gnuradio-runtime/include/gnuradio/nco.h
diff options
context:
space:
mode:
authorAndrej Rode <mail@andrejro.de>2018-02-17 23:24:10 +0100
committerAndrej Rode <mail@andrejro.de>2018-02-17 23:24:10 +0100
commit886ce0f13b4135c1206c26786e06a524e92fc271 (patch)
treefdf89824d4a5925c44f9b30d1e8d44b713c46b19 /gnuradio-runtime/include/gnuradio/nco.h
parent201031790ec8c855ec2eaf7883652ad37b164208 (diff)
math: replace M_PI and derivatives with GR_M_PI defines
Diffstat (limited to 'gnuradio-runtime/include/gnuradio/nco.h')
-rw-r--r--gnuradio-runtime/include/gnuradio/nco.h24
1 files changed, 13 insertions, 11 deletions
diff --git a/gnuradio-runtime/include/gnuradio/nco.h b/gnuradio-runtime/include/gnuradio/nco.h
index aff72068b9..e2256c3b70 100644
--- a/gnuradio-runtime/include/gnuradio/nco.h
+++ b/gnuradio-runtime/include/gnuradio/nco.h
@@ -1,6 +1,6 @@
/* -*- c++ -*- */
/*
- * Copyright 2002,2013 Free Software Foundation, Inc.
+ * Copyright 2002,2013,2018 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
@@ -25,6 +25,8 @@
#include <gnuradio/sincos.h>
#include <gnuradio/gr_complex.h>
+#include <gnuradio/math.h>
+
#include <vector>
#include <cmath>
@@ -69,24 +71,24 @@ namespace gr {
void step()
{
phase += phase_inc;
- if(fabs(phase) > M_PI) {
- while(phase > M_PI)
- phase -= 2*M_PI;
+ if(fabs(phase) > GR_M_PI) {
+ while(phase > GR_M_PI)
+ phase -= 2*GR_M_PI;
- while(phase < -M_PI)
- phase += 2*M_PI;
+ while(phase < -GR_M_PI)
+ phase += 2*GR_M_PI;
}
}
void step(int n)
{
phase += phase_inc * n;
- if(fabs(phase) > M_PI){
- while(phase > M_PI)
- phase -= 2*M_PI;
+ if(fabs(phase) > GR_M_PI){
+ while(phase > GR_M_PI)
+ phase -= 2*GR_M_PI;
- while(phase < -M_PI)
- phase += 2*M_PI;
+ while(phase < -GR_M_PI)
+ phase += 2*GR_M_PI;
}
}