1
0
mirror of https://github.com/php/php-src.git synced 2026-03-26 17:22:15 +01:00
Files
archived-php-src/ext/bcmath/tests/bug46781.phpt
Christoph M. Becker 9aa6898b9b Fixed bug #46781 (BC math handles minus zero incorrectly)
Actually, there is no negative zero at all.  We obey Postel's law, and
still accept negative zeroes, but we store them as positive zeroes
after the conversion from string, i.e. we normalize before further
processing.
2017-09-11 23:44:23 +02:00

17 lines
305 B
PHP

--TEST--
Bug #46781 (BC math handles minus zero incorrectly)
--SKIPIF--
<?php
if (!extension_loaded('bcmath')) die('skip bcmath extension is not available');
?>
--FILE--
<?php
var_dump(bcadd('-0.0', '-0.0', 1));
var_dump(bccomp('-0.0', '0', 1));
?>
===DONE===
--EXPECT--
string(3) "0.0"
int(0)
===DONE===