PageRenderTime 46ms CodeModel.GetById 24ms RepoModel.GetById 1ms app.codeStats 0ms

/tags/rel-1-3-26/SWIG/Examples/test-suite/python/complextest_runme.py

#
Python | 17 lines | 11 code | 6 blank | 0 comment | 3 complexity | 4e30274c02ac586b3ef44da4b3ab90d6 MD5 | raw file
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
  1. import complextest
  2. a = complex(-1,2)
  3. if complextest.Conj(a) != a.conjugate():
  4. raise RuntimeError, "bad complex mapping"
  5. if complextest.Conjf(a) != a.conjugate():
  6. raise RuntimeError, "bad complex mapping"
  7. v = (complex(1,2), complex(2,3), complex(4,3), 1)
  8. try:
  9. complextest.Copy_h(v)
  10. except:
  11. pass