mirror of
https://github.com/php/php-src.git
synced 2024-09-28 21:36:12 +00:00
90dcbbe3cb
bcmod() no longer truncates fractionals to integers. This matches the behavior of fmod(). It also matches the behavior of bcpowmod(). It also matches the behavior of bcmod() in HHVM.
21 lines
379 B
PHP
21 lines
379 B
PHP
--TEST--
|
|
bcmod() function
|
|
--SKIPIF--
|
|
<?php if(!extension_loaded("bcmath")) print "skip"; ?>
|
|
--INI--
|
|
bcmath.scale=0
|
|
--FILE--
|
|
<?php
|
|
echo bcmod("11", "2"),"\n";
|
|
echo bcmod("-1", "5"),"\n";
|
|
echo bcmod("8728932001983192837219398127471", "1928372132132819737213"),"\n";
|
|
echo bcmod("3.5", "4"),"\n";
|
|
echo bcmod("1071", "357.5"),"\n";
|
|
?>
|
|
--EXPECT--
|
|
1
|
|
-1
|
|
1459434331351930289678
|
|
3.5
|
|
356.0
|