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 this is not your bug, you can add a comment by following this link.
If this is your bug, but 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

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 08:01:28 2024 UTC