Bug #62845 [Com]: round returns -0
| From: | nikic@php.net | Date: | Fri, 17 Aug 2012 12:22:17 +0000 |
| Subject: | Bug #62845 [Com]: round returns -0 | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-172660@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=62845&edit=1
ID: 62845
Comment by: nikic@php.net
Reported by: bradley dot lee80 at googlemail dot com
Summary: round returns -0
Status: Open
Type: Bug
Package: Math related
Operating System: Linux (Ubuntu)
PHP Version: 5.3.16
Block user comment: N
Private report: N
New Comment:
Could you elaborate on why this would not be the expected behavior?
Also zero and negative zero are defined to compare equal, so I'm not sure whether this makes
any difference in practice.
Previous Comments:
------------------------------------------------------------------------
[2012-08-17 09:30:23] bradley dot lee80 at googlemail dot com
Description:
------------
---
From manual page: http://www.php.net/function.round#refsect1-function.round-description
---
The round function returns -0 if the value is a negative value that should round to 0
Test script:
---------------
<?php
echo round(-0.1);
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=62845&edit=1