php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #24828 round() function doesn't round !
Submitted: 2003-07-27 06:34 UTC Modified: 2003-07-28 17:08 UTC
From: christophe dot bidaux at netcourrier dot com Assigned: edink (profile)
Status: Closed Package: Math related
PHP Version: 4CVS-2003-07-27 (stable) OS: Windows 98SE
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: christophe dot bidaux at netcourrier dot com
New email:
PHP Version: OS:

 

 [2003-07-27 06:34 UTC] christophe dot bidaux at netcourrier dot com
Description:
------------
the round() function doesn't give me the results described in the documentation example.


Reproduce code:
---------------
// from the documentation example

$foo = round( 3.4 );   // $foo == 3.0
var_dump($foo);

$foo = round( 3.5 );   // $foo == 4.0
var_dump($foo);

$foo = round( 3.6 );   // $foo == 4.0
var_dump($foo);


Expected result:
----------------
float(3) float(4) float(4)

(PHP Version 4.3.3RC1 version)

Actual result:
--------------
float(3) float(3) float(3)

(PHP Version 4.3.3RC2-dev (Jul 27 2003 10:11:04) version)

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-07-28 17:08 UTC] edink@php.net
Fixed in the lates snapshot from snaps.php.net.
 
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Tue Dec 06 04:05:54 2022 UTC