33 lines
558 B
PHP
33 lines
558 B
PHP
--TEST--
|
|
Test for `Arma\Complex`.
|
|
--SKIPIF--
|
|
<?php
|
|
require_once 'includes/loaded.php';
|
|
is_php_arma_loaded();
|
|
?>
|
|
--FILE--
|
|
<?php
|
|
|
|
require_once 'includes/assert.php';
|
|
|
|
$cx_double = new Arma\CxDouble(1.2, 2.4);
|
|
[$real, $imag] = $cx_double;
|
|
|
|
batch_assert('Arma\\Complex',
|
|
[1.2, $cx_double->real],
|
|
[2.4, $cx_double->imag],
|
|
[$cx_double->real, $real],
|
|
[$cx_double->imag, $imag]
|
|
);
|
|
|
|
$cx_double->real *= 1.1;
|
|
$cx_double->imag *= 1.3;
|
|
|
|
batch_assert('Arma\\Complex',
|
|
[1.2 * 1.1, $cx_double->real],
|
|
[2.4 * 1.3, $cx_double->imag]
|
|
);
|
|
|
|
?>
|
|
--EXPECT--
|