diff options
author | Martin Braun <martin.braun@ettus.com> | 2014-09-04 11:32:16 +0200 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2014-09-04 11:32:16 +0200 |
commit | 0cbebe1b8f1fb23fd14630deddc9b0e08ec493b3 (patch) | |
tree | 644c5ad09125bf4a0789c0f855cac12f590d10c2 /gnuradio-runtime/python/pmt/qa_pmt.py | |
parent | 01deede32858ef9e2fe4cc937f3245b5b0e6d7c9 (diff) |
pmt: Added float conversion
Added to_float() and from_float(). These are basically aliases
for *_double() with a type cast for when strict typing is necessary
(e.g. SWIG won't accept an f32 value when using from_double()).
Diffstat (limited to 'gnuradio-runtime/python/pmt/qa_pmt.py')
-rwxr-xr-x | gnuradio-runtime/python/pmt/qa_pmt.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/gnuradio-runtime/python/pmt/qa_pmt.py b/gnuradio-runtime/python/pmt/qa_pmt.py index 5c1af2c00e..32cff62f44 100755 --- a/gnuradio-runtime/python/pmt/qa_pmt.py +++ b/gnuradio-runtime/python/pmt/qa_pmt.py @@ -36,7 +36,9 @@ class test_pmt(unittest.TestCase): const = 123765 x_pmt = pmt.from_double(const) x_int = pmt.to_double(x_pmt) + x_float = pmt.to_float(x_pmt) self.assertEqual(x_int, const) + self.assertEqual(x_float, const) def test03(self): v = pmt.init_f32vector(3, [11, -22, 33]) |