summaryrefslogtreecommitdiff
path: root/gr-trellis/docs/test_tcm.py
diff options
context:
space:
mode:
authorAndrej Rode <mail@andrejro.de>2018-08-06 01:09:43 +0200
committerMarcus Müller <marcus@hostalia.de>2018-08-17 19:59:23 +0200
commit48d535e9d9d95524b2c8ed35b44c7eda541aea68 (patch)
treea4511ac107e9d7ebb4b650dbd5ea8fb63e67d0a6 /gr-trellis/docs/test_tcm.py
parent6bfe4661a87cb7fc5f47ec219e89f8e6215bd03f (diff)
python: replace unfunctional old_div with functional code
a previous change to py3k introduced synactically incorrect `old_div` function calls. A replacement with `//` and `/` where applicable is more appropriate. Eventually `from __future__ import division` needs to be added as well to have the "real" division also for integer values in python closes #1902
Diffstat (limited to 'gr-trellis/docs/test_tcm.py')
-rw-r--r--gr-trellis/docs/test_tcm.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/gr-trellis/docs/test_tcm.py b/gr-trellis/docs/test_tcm.py
index e9a0ba59eb..9de627ec4c 100644
--- a/gr-trellis/docs/test_tcm.py
+++ b/gr-trellis/docs/test_tcm.py
@@ -82,8 +82,8 @@ def main(args):
Es = 0
for i in range(len(constellation)):
Es = Es + constellation[i]**2
- Es = Es / (old_div(len(constellation,dimensionality)))
- N0=Es / pow(10.0,old_div(esn0_db,10.0)); # noise variance
+ Es = Es / (len(constellation)//dimensionality)
+ N0=Es / pow(10.0,esn0_db/10.0); # noise variance
tot_s=0
terr_s=0