php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #1977 round() rounds .5's down, not up .. ie: 1.5 rounds to 1, 2.5 rounds to 2, etc.
Submitted: 1999-08-05 17:56 UTC Modified: 1999-08-05 23:54 UTC
From: nick at surreallogic dot com Assigned:
Status: Closed Package: Misbehaving function
PHP Version: 3.0.11 OS: Win32
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: nick at surreallogic dot com
New email:
PHP Version: OS:

 

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [1999-08-05 23:54 UTC] rasmus at cvs dot php dot net
This is by no means a bug.  Go read a math book please.  The commonly implemented rule for rounding a .5 number is to round up if the previous significant digit is odd and down if the previous significant digit is even.
Also see: http://www.progressive-comp.com/Lists/?l=php3-general&m=93230944323512&w=2
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Thu Oct 08 08:00:01 2026 UTC