summaryrefslogtreecommitdiff
path: root/tests/run/complex_numbers_cmath_T2891.pyx
blob: a5b1a65ea53e232dee61b6f041e59a4d5df66cc1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# ticket: 2891
# tag: c, no-cpp

cdef extern from "complex_numbers_c99_T398.h": pass

from libc.complex cimport cimag, creal, cabs, carg


def test_decomposing(double complex z):
    """
    >>> test_decomposing(3+4j)
    (3.0, 4.0, 5.0, 0.9272952180016122)
    """

    return (creal(z), cimag(z), cabs(z), carg(z))