点击回首页
我的浏览记录 | | 帮助?
当前位置:
首页>> 行业软件>> 在线考试系统>> 源文件浏览
[免费版 Free] WebForm,下载次数:403 次 | 关键字: 考试 办公 高校 竞赛 企事业单位

源码截图

源码目录树

;
当前路径:vendor/markbaker/complex/examples/complexTest.php
<?php

use Complex\Complex as Complex;

include('../classes/Bootstrap.php');

echo 'Create', PHP_EOL;

$x = new Complex(123);
echo $x, PHP_EOL;

$x = new Complex(123, 456);
echo $x, PHP_EOL;

$x = new Complex(array(123,456,'j'));
echo $x, PHP_EOL;

$x = new Complex('1.23e-4--2.34e-5i');
echo $x, PHP_EOL;


echo PHP_EOL, 'Add', PHP_EOL;

$x = new Complex(123);
$x->add(456);
echo $x, PHP_EOL;

$x = new Complex(123.456);
$x->add(789.012);
echo $x, PHP_EOL;

$x = new Complex(123.456, 78.90);
$x->add(new Complex(-987.654, -32.1));
echo $x, PHP_EOL;

$x = new Complex(123.456, 78.90);
$x->add(-987.654);
echo $x, PHP_EOL;

$x = new Complex(-987.654, -32.1);
$x->add(new Complex(0, 1));
echo $x, PHP_EOL;

$x = new Complex(-987.654, -32.1);
$x->add(new Complex(0, -1));
echo $x, PHP_EOL;


echo PHP_EOL, 'Subtract', PHP_EOL;

$x = new Complex(123);
$x->subtract(456);
echo $x, PHP_EOL;

$x = new Complex(123.456);
$x->subtract(789.012);
echo $x, PHP_EOL;

$x = new Complex(123.456, 78.90);
$x->subtract(new Complex(-987.654, -32.1));
echo $x, PHP_EOL;

$x = new Complex(123.456, 78.90);
$x->subtract(-987.654);
echo $x, PHP_EOL;

$x = new Complex(-987.654, -32.1);
$x->subtract(new Complex(0, 1));
echo $x, PHP_EOL;

$x = new Complex(-987.654, -32.1);
$x->subtract(new Complex(0, -1));
echo $x, PHP_EOL;


echo PHP_EOL, 'Multiply', PHP_EOL;

$x = new Complex(123);
$x->multiply(456);
echo $x, PHP_EOL;

$x = new Complex(123.456);
$x->multiply(789.012);
echo $x, PHP_EOL;

$x = new Complex(123.456, 78.90);
$x->multiply(new Complex(-987.654, -32.1));
echo $x, PHP_EOL;

$x = new Complex(123.456, 78.90);
$x->multiply(-987.654);
echo $x, PHP_EOL;

$x = new Complex(-987.654, -32.1);
$x->multiply(new Complex(0, 1));
echo $x, PHP_EOL;

$x = new Complex(-987.654, -32.1);
$x->multiply(new Complex(0, -1));
echo $x, PHP_EOL;


echo PHP_EOL, 'Divide By', PHP_EOL;

$x = new Complex(123);
$x->divideBy(456);
echo $x, PHP_EOL;

$x = new Complex(123.456);
$x->divideBy(789.012);
echo $x, PHP_EOL;

$x = new Complex(123.456, 78.90);
$x->divideBy(new Complex(-987.654, -32.1));
echo $x, PHP_EOL;

$x = new Complex(123.456, 78.90);
$x->divideBy(-987.654);
echo $x, PHP_EOL;

$x = new Complex(-987.654, -32.1);
$x->divideBy(new Complex(0, 1));
echo $x, PHP_EOL;

$x = new Complex(-987.654, -32.1);
$x->divideBy(new Complex(0, -1));
echo $x, PHP_EOL;


echo PHP_EOL, 'Divide Into', PHP_EOL;

$x = new Complex(123);
$x->divideInto(456);
echo $x, PHP_EOL;

$x = new Complex(123.456);
$x->divideInto(789.012);
echo $x, PHP_EOL;

$x = new Complex(123.456, 78.90);
$x->divideInto(new Complex(-987.654, -32.1));
echo $x, PHP_EOL;

$x = new Complex(123.456, 78.90);
$x->divideInto(-987.654);
echo $x, PHP_EOL;

$x = new Complex(-987.654, -32.1);
$x->divideInto(new Complex(0, 1));
echo $x, PHP_EOL;

$x = new Complex(-987.654, -32.1);
$x->divideInto(new Complex(0, -1));
echo $x, PHP_EOL;
关于我们 | 顾问团队 | 发展历程 | 联系我们 | 源码上传
联系电话(Tel):4008-010-151(免长途)
地址:北京市海淀区大恒科技大厦五层 邮编:100080
Floor 5th,Daheng Building,Zhongguancun,Beijing,China,100080
51Aspx.com 版权所有 CopyRight © 2006-2022. 京ICP备09089570号 | 京公网安备11010702000869号