From: Robert Bradshaw Date: Fri, 12 Nov 2010 09:22:22 +0000 (-0800) Subject: Complex inplace operators test. X-Git-Tag: 0.14.alpha0~178^2~2 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=cea8b4637730c41ec800786351e18dc0ceb5c052;p=cython.git Complex inplace operators test. --- diff --git a/tests/run/inplace.pyx b/tests/run/inplace.pyx index 5bdc256f..43a417b3 100644 --- a/tests/run/inplace.pyx +++ b/tests/run/inplace.pyx @@ -147,3 +147,16 @@ def test_inplace_pydivision(int a, int b): """ a %= b return a + +def test_complex_inplace(double complex x, double complex y): + """ + >>> test_complex_inplace(1, 1) + (2+0j) + >>> test_complex_inplace(2, 3) + (15+0j) + >>> test_complex_inplace(2+3j, 4+5j) + (-16+62j) + """ + x += y + x *= y + return x