gcc/libstdc++/tests/tcomplex.exp
Jason Merrill 6599da043e Initial revision
From-SVN: r14877
1997-08-21 18:57:35 -04:00

38 lines
782 B
Plaintext

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