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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
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

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: Sun Oct 27 16:01:27 2024 UTC