summaryrefslogtreecommitdiffstats
path: root/contrib/libstdc++/tests/tcomplex.exp
blob: 5bef15cd37692b6d22cee88ca3362d6cd2f3180f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
double_complex one = (1,0)
i = (0,1)
neg_one = (-1,0)
sqrt(neg_one) = (0,1)
a = (2,3)
b = (4,5)
a + one = (3,3)
a - one = (1,3)
a * one = (2,3)
a / one = (2,3)
a + b = (6,8)
a - b = (-2,-2)
a * b = (-7,22)
a / b = (0.560976,0.0487805)
c = a; c += b = (6,8)
c = a; c -= b = (-2,-2)
c = a; c *= b = (-7,22)
c = a; c /= b = (0.560976,0.0487805)
-a = (-2,-3)
real(a) = 2
imag(a) = 3
conj(a) = (2,-3)
norm(a) = 13
abs(a) = 3.60555
arg(a) = 0.982794
cos(a) = (-4.18963,-9.10923)
sin(a) = (9.1545,-4.16891)
cosh(a) = (-3.72455,0.511823)
sinh(a) = (-3.59056,0.530921)
log(a) = (1.28247,0.982794)
exp(a) = (-7.31511,1.04274)
sqrt(a) = (1.67415,0.895977)
pow(a, 2) = (-5,12)
pow(a, b) = (-0.753046,-0.986429)
enter a complex number in form a or (a) or (a, b): number = (1.2,-34)

End of test
OpenPOWER on IntegriCloud