Bug #75648 [Csd->Nab]: round() does not respect mode when precision is negative

From: Date: Thu, 07 Dec 2017 16:11:21 +0000
Subject: Bug #75648 [Csd->Nab]: round() does not respect mode when precision is negative
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-213002@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
 Updated by:         requinix@php.net
 Reported by:        mcsoftware at alikuvkoutek dot cz
 Summary:            round() does not respect mode when precision is
                     negative
-Status:             Closed
+Status:             Not a bug
 Type:               Bug
 Package:            Math related
 PHP Version:        7.1.12
 Block user comment: N
 Private report:     N



Previous Comments:
------------------------------------------------------------------------
[2017-12-07 15:58:39] mcsoftware at alikuvkoutek dot cz

Sorry, I was expecting ceil/floor bevaior and the mode is just for the "half" numbers.

------------------------------------------------------------------------
[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


Thread (3 messages)

« previous php.bugs (#213002) next »