summaryrefslogtreecommitdiff
path: root/gnuradio-runtime/lib/math
diff options
context:
space:
mode:
Diffstat (limited to 'gnuradio-runtime/lib/math')
-rw-r--r--gnuradio-runtime/lib/math/fast_atan2f.cc2
-rw-r--r--gnuradio-runtime/lib/math/fxpt.cc1
-rw-r--r--gnuradio-runtime/lib/math/qa_fxpt.cc2
-rw-r--r--gnuradio-runtime/lib/math/random.cc12
4 files changed, 9 insertions, 8 deletions
diff --git a/gnuradio-runtime/lib/math/fast_atan2f.cc b/gnuradio-runtime/lib/math/fast_atan2f.cc
index f968310ff8..72e7291913 100644
--- a/gnuradio-runtime/lib/math/fast_atan2f.cc
+++ b/gnuradio-runtime/lib/math/fast_atan2f.cc
@@ -114,7 +114,7 @@ namespace gr {
Description: This function calculates the angle of the vector (x,y)
based on a table lookup and linear interpolation. The table uses a
- 256 point table covering -45 to +45 degrees and uses symetry to
+ 256 point table covering -45 to +45 degrees and uses symmetry to
determine the final angle value in the range of -180 to 180
degrees. Note that this function uses the small angle approximation
for values close to zero. This routine calculates the arc tangent
diff --git a/gnuradio-runtime/lib/math/fxpt.cc b/gnuradio-runtime/lib/math/fxpt.cc
index 23fdda1241..b40b082194 100644
--- a/gnuradio-runtime/lib/math/fxpt.cc
+++ b/gnuradio-runtime/lib/math/fxpt.cc
@@ -33,6 +33,7 @@ namespace gr {
};
const float fxpt::PI = 3.14159265358979323846;
+ const float fxpt::TAU = 2.0 * 3.14159265358979323846;
const float fxpt::TWO_TO_THE_31 = 2147483648.0;
} /* namespace gr */
diff --git a/gnuradio-runtime/lib/math/qa_fxpt.cc b/gnuradio-runtime/lib/math/qa_fxpt.cc
index 070fb66ccf..d3aadf85b1 100644
--- a/gnuradio-runtime/lib/math/qa_fxpt.cc
+++ b/gnuradio-runtime/lib/math/qa_fxpt.cc
@@ -46,7 +46,7 @@ qa_fxpt::t0()
* These are disabled because of some precision issues.
*
* Different compilers seem to have different opinions on whether
- * the calulations are done single or double (or extended)
+ * the calculations are done single or double (or extended)
* precision. Any of the answers are fine for our real purpose, but
* sometimes the answer is off by a few bits at the bottom.
* Hence, the disabled check.
diff --git a/gnuradio-runtime/lib/math/random.cc b/gnuradio-runtime/lib/math/random.cc
index 59f2f22bd0..401ba89735 100644
--- a/gnuradio-runtime/lib/math/random.cc
+++ b/gnuradio-runtime/lib/math/random.cc
@@ -130,8 +130,8 @@ namespace gr {
s = x*x+y*y;
}while(s >= 1.0f || s == 0.0f);
d_gauss_stored = true;
- d_gauss_value = x*sqrt(-2.0*log(s)/s);
- return y*sqrt(-2.0*log(s)/s);
+ d_gauss_value = x*sqrtf(-2.0*logf(s)/s);
+ return y*sqrtf(-2.0*logf(s)/s);
}
}
@@ -139,8 +139,8 @@ namespace gr {
random::laplacian()
{
float z = ran1()-0.5;
- if(z>0) return -log(1-2*z);
- else return log(1+2*z);
+ if(z>0) return -logf(1-2*z);
+ else return logf(1+2*z);
}
/*
@@ -151,7 +151,7 @@ namespace gr {
float
random::impulse(float factor = 5)
{
- float z = -M_SQRT2 * log(ran1());
+ float z = -M_SQRT2 * logf(ran1());
if(fabsf(z) <= factor)
return 0.0;
else
@@ -167,7 +167,7 @@ namespace gr {
float
random::rayleigh()
{
- return sqrt(-2.0 * log(ran1()));
+ return sqrtf(-2.0 * logf(ran1()));
}
} /* namespace gr */