diff options
author | Marcus Müller <marcus@hostalia.de> | 2018-06-25 19:28:29 +0200 |
---|---|---|
committer | Marcus Müller <marcus@hostalia.de> | 2018-06-25 19:28:29 +0200 |
commit | 03ae7938351f01313d30a41927ffb77670fcca14 (patch) | |
tree | 586744f0e2b7560dc161f2a7a60030155d43ce8a /gnuradio-runtime/lib/math | |
parent | d78f7fcd0dadd362fcdc99194da5343a506eb519 (diff) | |
parent | c66aec4dfae559004e88da968d1ce57584e144ee (diff) |
Merge branch 'next_python3' into next
This brings Python3 to `next`.
It also brings
* a bump in SWIG dependency version
* various GRC improvements,
* YAML instead of XML in GRC
* a lot of broken unit tests
Diffstat (limited to 'gnuradio-runtime/lib/math')
-rw-r--r--[-rwxr-xr-x] | gnuradio-runtime/lib/math/gen_sine_table.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/gnuradio-runtime/lib/math/gen_sine_table.py b/gnuradio-runtime/lib/math/gen_sine_table.py index d7d11eff11..75e3a0c58f 100755..100644 --- a/gnuradio-runtime/lib/math/gen_sine_table.py +++ b/gnuradio-runtime/lib/math/gen_sine_table.py @@ -20,6 +20,8 @@ # Boston, MA 02110-1301, USA. # +from __future__ import division +from __future__ import unicode_literals import math import sys @@ -38,8 +40,8 @@ def gen_approx_table (f, nentries, min_x, max_x): for i in range (nentries): a = (i * incx) + min_x b = ((i + 1) * incx) + min_x - m = (f(b)-f(a))/(b-a) - c = (3*a+b)*(f(a)-f(b))/(4*(b-a)) + (f((a+b)/2) + f(a))/2 + m = (f(b)-f(a)) / (b-a) + c = (3*a+b)*(f(a)-f(b))/(4*(b-a)) + (f(old_div((a+b) / 2) + f(a)),2) abs_error = c+m*a-f(a) r.append ((m, c, abs_error)) return r |