]> granicus.if.org Git - php/commitdiff
This commit was manufactured by cvs2svn to create branch 'PHP_4_3'.
authorSVN Migration <svn@php.net>
Thu, 21 Nov 2002 15:24:46 +0000 (15:24 +0000)
committerSVN Migration <svn@php.net>
Thu, 21 Nov 2002 15:24:46 +0000 (15:24 +0000)
ext/bcmath/tests/bcadd.phpt [new file with mode: 0644]
ext/bcmath/tests/bccomp.phpt [new file with mode: 0644]
ext/bcmath/tests/bcdiv.phpt [new file with mode: 0644]
ext/bcmath/tests/bcmod.phpt [new file with mode: 0644]
ext/bcmath/tests/bcmul.phpt [new file with mode: 0644]
ext/bcmath/tests/bcpow.phpt [new file with mode: 0644]
ext/bcmath/tests/bcscale.phpt [new file with mode: 0644]
ext/bcmath/tests/bcsqrt.phpt [new file with mode: 0644]
ext/bcmath/tests/bcsub.phpt [new file with mode: 0644]

diff --git a/ext/bcmath/tests/bcadd.phpt b/ext/bcmath/tests/bcadd.phpt
new file mode 100644 (file)
index 0000000..5713057
--- /dev/null
@@ -0,0 +1,14 @@
+--TEST--
+bcadd() function
+--SKIP--
+<?php if(!extension_loaded("bcmath")) print "skip"; ?>
+--FILE--
+<?php
+echo bcadd("1", "2"),"\n";
+echo bcadd("-1", "5", 4),"\n";
+echo bcadd("1928372132132819737213", "8728932001983192837219398127471", 2),"\n";
+?>
+--EXPECT--
+3
+4.0000
+8728932003911564969352217864684.00
diff --git a/ext/bcmath/tests/bccomp.phpt b/ext/bcmath/tests/bccomp.phpt
new file mode 100644 (file)
index 0000000..f1b389a
--- /dev/null
@@ -0,0 +1,16 @@
+--TEST--
+bccomp() function
+--SKIP--
+<?php if(!extension_loaded("bcmath")) print "skip"; ?>
+--FILE--
+<?php
+echo bccomp("-1", "5", 4),"\n";
+echo bccomp("1928372132132819737213", "8728932001983192837219398127471"),"\n";
+echo bccomp("1.00000000000000000001", "1", 2),"\n";
+echo bccomp("97321", "2321"),"\n";
+?>
+--EXPECT--
+-1
+-1
+0
+1
diff --git a/ext/bcmath/tests/bcdiv.phpt b/ext/bcmath/tests/bcdiv.phpt
new file mode 100644 (file)
index 0000000..2bba262
--- /dev/null
@@ -0,0 +1,16 @@
+--TEST--
+bcdiv() function
+--SKIP--
+<?php if(!extension_loaded("bcmath")) print "skip"; ?>
+--FILE--
+<?php
+echo bcdiv("1", "2"),"\n";
+echo bcdiv("1", "2", 2),"\n";
+echo bcdiv("-1", "5", 4),"\n";
+echo bcdiv("8728932001983192837219398127471", "1928372132132819737213", 2),"\n";
+?>
+--EXPECT--
+0
+0.50
+-0.2000
+4526580661.75
diff --git a/ext/bcmath/tests/bcmod.phpt b/ext/bcmath/tests/bcmod.phpt
new file mode 100644 (file)
index 0000000..74bec5a
--- /dev/null
@@ -0,0 +1,14 @@
+--TEST--
+bcmod() function
+--SKIP--
+<?php if(!extension_loaded("bcmath")) print "skip"; ?>
+--FILE--
+<?php
+echo bcmod("11", "2"),"\n";
+echo bcmod("-1", "5"),"\n";
+echo bcmod("8728932001983192837219398127471", "1928372132132819737213"),"\n";
+?>
+--EXPECT--
+1
+-1
+1459434331351930289678
diff --git a/ext/bcmath/tests/bcmul.phpt b/ext/bcmath/tests/bcmul.phpt
new file mode 100644 (file)
index 0000000..76891f3
--- /dev/null
@@ -0,0 +1,16 @@
+--TEST--
+bcmul() function
+--SKIP--
+<?php if(!extension_loaded("bcmath")) print "skip"; ?>
+--FILE--
+<?php
+echo bcmul("1", "2"),"\n";
+echo bcmul("-3", "5"),"\n";
+echo bcmul("1234567890", "9876543210"),"\n";
+echo bcmul("2.5", "1.5", 2),"\n";
+?>
+--EXPECT--
+2
+-15
+12193263111263526900
+3.75
diff --git a/ext/bcmath/tests/bcpow.phpt b/ext/bcmath/tests/bcpow.phpt
new file mode 100644 (file)
index 0000000..69ff171
--- /dev/null
@@ -0,0 +1,14 @@
+--TEST--
+bcpow() function
+--SKIP--
+<?php if(!extension_loaded("bcmath")) print "skip"; ?>
+--FILE--
+<?php
+echo bcpow("1", "2"),"\n";
+echo bcpow("-2", "5", 4),"\n";
+echo bcpow("2", "64"),"\n";
+?>
+--EXPECT--
+1
+-32
+18446744073709551616
diff --git a/ext/bcmath/tests/bcscale.phpt b/ext/bcmath/tests/bcscale.phpt
new file mode 100644 (file)
index 0000000..742c7ad
--- /dev/null
@@ -0,0 +1,19 @@
+--TEST--
+bcscale() function
+--SKIP--
+<?php if(!extension_loaded("bcmath")) print "skip"; ?>
+--FILE--
+<?php
+echo bcadd("1", "2"),"\n";
+bcscale(2);
+echo bcadd("1", "2"),"\n";
+bcscale(10);
+echo bcadd("1", "2"),"\n";
+bcscale(0);
+echo bcadd("1", "2"),"\n";
+?>
+--EXPECT--
+3
+3.00
+3.0000000000
+3
diff --git a/ext/bcmath/tests/bcsqrt.phpt b/ext/bcmath/tests/bcsqrt.phpt
new file mode 100644 (file)
index 0000000..b9b243b
--- /dev/null
@@ -0,0 +1,12 @@
+--TEST--
+bcsqrt() function
+--SKIP--
+<?php if(!extension_loaded("bcmath")) print "skip"; ?>
+--FILE--
+<?php
+echo bcsqrt("9"),"\n";
+echo bcsqrt("1928372132132819737213", 5),"\n";
+?>
+--EXPECT--
+3
+43913234134.28826
diff --git a/ext/bcmath/tests/bcsub.phpt b/ext/bcmath/tests/bcsub.phpt
new file mode 100644 (file)
index 0000000..918eaad
--- /dev/null
@@ -0,0 +1,14 @@
+--TEST--
+bcsub() function
+--SKIP--
+<?php if(!extension_loaded("bcmath")) print "skip"; ?>
+--FILE--
+<?php
+echo bcsub("1", "2"),"\n";
+echo bcsub("-1", "5", 4),"\n";
+echo bcsub("8728932001983192837219398127471", "1928372132132819737213", 2),"\n";
+?>
+--EXPECT--
+-1
+-6.0000
+8728932000054820705086578390258.00