Commit cea8b463 authored by Robert Bradshaw's avatar Robert Bradshaw

Complex inplace operators test.

parent 0cb6983c
...@@ -147,3 +147,16 @@ def test_inplace_pydivision(int a, int b): ...@@ -147,3 +147,16 @@ def test_inplace_pydivision(int a, int b):
""" """
a %= b a %= b
return a 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
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment