php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #38683 Incorrect round()
Submitted: 2006-09-01 20:23 UTC Modified: 2006-09-01 21:13 UTC
From: whitephoenix at mail dot ru Assigned:
Status: Not a bug Package: Unknown/Other Function
PHP Version: 5CVS-2006-09-01 (CVS) OS: WinXP. PHP 5.2.0 RC3
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: whitephoenix at mail dot ru
New email:
PHP Version: OS:

 

 [2006-09-01 20:23 UTC] whitephoenix at mail dot ru
Description:
------------
see code :)

Reproduce code:
---------------
echo round(0.123);

Expected result:
----------------
0

Actual result:
--------------
0.123

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-09-01 21:12 UTC] edink@php.net
You must be doing something wrong there:

C:\php4build\installer\Files>php -v
PHP 5.2.0RC3 (cli) (built: Sep  1 2006 16:29:07)
Copyright (c) 1997-2006 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2006 Zend Technologies

C:\php4build\installer\Files>php -r "var_dump(round(0.123));"
float(0)
 [2006-09-01 21:13 UTC] edink@php.net
.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sun Dec 07 08:00:01 2025 UTC