5include(
'../classes/Bootstrap.php');
12$x =
new Complex(123, 456);
15$x =
new Complex(array(123,456,
'j'));
18$x =
new Complex(
'1.23e-4--2.34e-5i');
28$x =
new Complex(123.456);
32$x =
new Complex(123.456, 78.90);
33$x->add(
new Complex(-987.654, -32.1));
36$x =
new Complex(123.456, 78.90);
40$x =
new Complex(-987.654, -32.1);
41$x->add(
new Complex(0, 1));
44$x =
new Complex(-987.654, -32.1);
45$x->add(
new Complex(0, -1));
55$x =
new Complex(123.456);
59$x =
new Complex(123.456, 78.90);
60$x->subtract(
new Complex(-987.654, -32.1));
63$x =
new Complex(123.456, 78.90);
64$x->subtract(-987.654);
67$x =
new Complex(-987.654, -32.1);
68$x->subtract(
new Complex(0, 1));
71$x =
new Complex(-987.654, -32.1);
72$x->subtract(
new Complex(0, -1));
82$x =
new Complex(123.456);
86$x =
new Complex(123.456, 78.90);
87$x->multiply(
new Complex(-987.654, -32.1));
90$x =
new Complex(123.456, 78.90);
91$x->multiply(-987.654);
94$x =
new Complex(-987.654, -32.1);
95$x->multiply(
new Complex(0, 1));
98$x =
new Complex(-987.654, -32.1);
99$x->multiply(
new Complex(0, -1));
105$x =
new Complex(123);
109$x =
new Complex(123.456);
110$x->divideBy(789.012);
113$x =
new Complex(123.456, 78.90);
114$x->divideBy(
new Complex(-987.654, -32.1));
117$x =
new Complex(123.456, 78.90);
118$x->divideBy(-987.654);
121$x =
new Complex(-987.654, -32.1);
122$x->divideBy(
new Complex(0, 1));
125$x =
new Complex(-987.654, -32.1);
126$x->divideBy(
new Complex(0, -1));
132$x =
new Complex(123);
136$x =
new Complex(123.456);
137$x->divideInto(789.012);
140$x =
new Complex(123.456, 78.90);
141$x->divideInto(
new Complex(-987.654, -32.1));
144$x =
new Complex(123.456, 78.90);
145$x->divideInto(-987.654);
148$x =
new Complex(-987.654, -32.1);
149$x->divideInto(
new Complex(0, 1));
152$x =
new Complex(-987.654, -32.1);
153$x->divideInto(
new Complex(0, -1));
An exception for terminatinating execution or to throw for unit testing.