Bug #75648 [Opn->Csd]: round() does not respect mode when precision is negative
| From: | mcsoftware at alikuvkoutek dot cz | Date: | Thu, 07 Dec 2017 15:58:41 +0000 |
| Subject: | Bug #75648 [Opn->Csd]: round() does not respect mode when precision is negative | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-213000@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=75648&edit=1
ID: 75648
User updated by: mcsoftware at alikuvkoutek dot cz
Reported by: mcsoftware at alikuvkoutek dot cz
Summary: round() does not respect mode when precision is
negative
-Status: Open
+Status: Closed
Type: Bug
Package: Math related
PHP Version: 7.1.12
Block user comment: N
Private report: N
New Comment:
Sorry, I was expecting ceil/floor bevaior and the mode is just for the "half" numbers.
Previous Comments:
------------------------------------------------------------------------
[2017-12-07 15:51:18] mcsoftware at alikuvkoutek dot cz
Description:
------------
Round does not round up when precision is negative even PHP_ROUND_HALF_UP mode is provided.
Test script:
---------------
echo round(123, -2, PHP_ROUND_HALF_UP);
Expected result:
----------------
200
Actual result:
--------------
100
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=75648&edit=1