summaryrefslogtreecommitdiff
path: root/Build/source/utils/asymptote/tests/arith/pair.asy
blob: c815f28b2fa616e12a3cbafb85c8689e199dcb51 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import TestLib;

StartTest("complex addition");
assert((1,0)+(0,1)==(1,1));
EndTest();
StartTest("complex subtraction");
assert((1,0)-(0,1)==(1,-1));
EndTest();
StartTest("complex multiplication");
assert((1,2)*(2,1)==(0,5));
EndTest();
StartTest("complex division");
assert((0,5)/(2,1)==(1,2));
EndTest();
StartTest("length(pair)");
assert(length((0.0,1.0)) == 1.0);
EndTest();
StartTest("conj()");
assert(conj((0.0,1.0))==(0.0, -1.0));
EndTest();