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
 [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

Add a Patch

Pull Requests

Add a Pull Request

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-2024 The PHP Group
All rights reserved.
Last updated: Fri May 17 22:01:31 2024 UTC