diff options
author | Martin Braun <martin.braun@ettus.com> | 2018-02-03 15:36:58 +0100 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2018-02-03 15:36:58 +0100 |
commit | a35e10870bbb9a71b3ab66b1dc58135e08c9543e (patch) | |
tree | a9b1df0f4acc58c6615a15442495292827b8ca40 /gnuradio-runtime/lib/math | |
parent | a212beb816781416d24d1c2b7ea31265ad702f33 (diff) | |
parent | 7365f030cdc690c00a0cd7d2dc418275495243e9 (diff) |
Merge branch 'maint'
Diffstat (limited to 'gnuradio-runtime/lib/math')
-rw-r--r-- | gnuradio-runtime/lib/math/fxpt.cc | 1 | ||||
-rw-r--r-- | gnuradio-runtime/lib/math/random.cc | 12 |
2 files changed, 7 insertions, 6 deletions
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/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 */ |