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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: kamfalg at gmail dot com
New email:
PHP Version: OS:

 

 [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

Add a Patch

Pull Requests

Add a Pull Request

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-2021 The PHP Group
All rights reserved.
Last updated: Tue Jan 19 22:01:23 2021 UTC