aboutsummaryrefslogtreecommitdiff
path: root/Examples/test-suite/python/ccomplextest_runme.py
blob: 63a663f502e13181bbfd749437db0ff2ca4607c7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import ccomplextest

a = complex(-1, 2)

if ccomplextest.has_c99_complex():
    if ccomplextest.Conj(a) != a.conjugate():
        raise RuntimeError("bad complex mapping")

    if ccomplextest.Conjf(a) != a.conjugate():
        raise RuntimeError("bad complex mapping")

    if ccomplextest.Conj2(a) != a.conjugate():
        raise RuntimeError("bad complex mapping")

    if ccomplextest.Conjf2(a) != a.conjugate():
        raise RuntimeError("bad complex mapping")

    if ccomplextest.Conj3(a) != a.conjugate():
        raise RuntimeError("bad complex mapping")

    if ccomplextest.Conjf3(a) != a.conjugate():
        raise RuntimeError("bad complex mapping")