php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #68251 round() var in -1 to 0 return "-0" - it's nosense
Submitted: 2014-10-17 13:11 UTC Modified: 2014-10-17 14:45 UTC
From: kamfalg at gmail dot com Assigned:
Status: Not a bug Package: *Math Functions
PHP Version: 5.4.34 OS: debian
Private report: No CVE-ID: None
 [2014-10-17 13:11 UTC] kamfalg at gmail dot com
Description:
------------
It should return 0. "-0" is nosense

Test script:
---------------
echo round(-0.123);


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2014-10-17 13:14 UTC] kamfalg at gmail dot com
-Summary: . +Summary: round() var in -1 to 0 return "-0" - it's nosense
 [2014-10-17 13:14 UTC] kamfalg at gmail dot com
edit
 [2014-10-17 14:45 UTC] nikic@php.net
-Status: Open +Status: Not a bug
 [2014-10-17 14:45 UTC] nikic@php.net
The -0 result is in accordance with IEEE 754. Please see http://en.wikipedia.org/wiki/Signed_zero for some basic info on negative zero.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Dec 26 12:01:30 2024 UTC