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
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
16 - 11 = ?
Subscribe to this entry?

 
 [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-2024 The PHP Group
All rights reserved.
Last updated: Sun Jul 14 05:01:30 2024 UTC