ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
testOperations.php
Go to the documentation of this file.
1 <?php
2 
4 
5 include('../classes/Bootstrap.php');
6 
7 $values = [
8  new Complex(123),
9  new Complex(456, 123),
10  new Complex(0.0, 456),
11 ];
12 
13 foreach ($values as $value) {
14  echo $value, PHP_EOL;
15 }
16 
17 echo 'Addition', PHP_EOL;
18 
20 echo '=> ', $result, PHP_EOL;
21 
23 
24 echo 'Subtraction', PHP_EOL;
25 
26 $result = \Complex\subtract(...$values);
27 echo '=> ', $result, PHP_EOL;
28 
30 
31 echo 'Multiplication', PHP_EOL;
32 
33 $result = \Complex\multiply(...$values);
34 echo '=> ', $result, PHP_EOL;
PHP_EOL
$result
$values
add()
Definition: add.php:2