This repository has been archived on 2020-06-07. You can view files and clone it, but cannot push or open issues or pull requests.
php-armadillo/tests/001-complex.phpt

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--