mirror of
https://github.com/php/php-src.git
synced 2024-09-22 18:37:25 +00:00
a07d422ade
Co-Authored-By: Nikita Popov <nikita.ppv@googlemail.com> Co-Authored-By: Christoph M. Becker <cmbecker69@gmx.de>
69 lines
1.7 KiB
PHP
69 lines
1.7 KiB
PHP
--TEST--
|
|
bcmath lib arguments formatting
|
|
--DESCRIPTION--
|
|
1 and 2 argument of bcadd/bcsub/bcmul/bcdiv/bcmod/bcpowmod/bcpow/bccomp (last one works different then others internally);
|
|
1 argument of bcsqrt
|
|
All of the name above must be well-formed
|
|
--SKIPIF--
|
|
<?php if(!extension_loaded("bcmath")) print "skip"; ?>
|
|
--FILE--
|
|
<?php
|
|
echo bcadd("1", "2"),"\n";
|
|
echo bcadd("1.1", "2", 2),"\n";
|
|
echo bcadd("", "2", 2),"\n";
|
|
echo bcadd("+0", "2"), "\n";
|
|
echo bcadd("-0", "2"), "\n";
|
|
|
|
echo bcadd(" 0", "2");
|
|
echo bcadd("1e1", "2");
|
|
echo bcadd("1,1", "2");
|
|
echo bcadd("Hello", "2");
|
|
echo bcadd("1 1", "2");
|
|
echo "\n", "\n";
|
|
|
|
echo bccomp("1", "2"),"\n";
|
|
echo bccomp("1.1", "2", 2),"\n";
|
|
echo bccomp("", "2"),"\n";
|
|
echo bccomp("+0", "2"), "\n";
|
|
echo bccomp("-0", "2"), "\n";
|
|
|
|
echo bccomp(" 0", "2");
|
|
echo bccomp("1e1", "2");
|
|
echo bccomp("1,1", "2");
|
|
echo bccomp("Hello", "2");
|
|
echo bccomp("1 1", "2");
|
|
?>
|
|
--EXPECTF--
|
|
3
|
|
3.10
|
|
2.00
|
|
2
|
|
2
|
|
|
|
Warning: bcadd(): bcmath function argument is not well-formed in %s on line %d
|
|
2
|
|
Warning: bcadd(): bcmath function argument is not well-formed in %s on line %d
|
|
2
|
|
Warning: bcadd(): bcmath function argument is not well-formed in %s on line %d
|
|
2
|
|
Warning: bcadd(): bcmath function argument is not well-formed in %s on line %d
|
|
2
|
|
Warning: bcadd(): bcmath function argument is not well-formed in %s on line %d
|
|
2
|
|
|
|
-1
|
|
-1
|
|
-1
|
|
-1
|
|
-1
|
|
|
|
Warning: bccomp(): bcmath function argument is not well-formed in %s on line %d
|
|
-1
|
|
Warning: bccomp(): bcmath function argument is not well-formed in %s on line %d
|
|
-1
|
|
Warning: bccomp(): bcmath function argument is not well-formed in %s on line %d
|
|
-1
|
|
Warning: bccomp(): bcmath function argument is not well-formed in %s on line %d
|
|
-1
|
|
Warning: bccomp(): bcmath function argument is not well-formed in %s on line %d
|
|
-1
|