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
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
37 + 2 = ?
Subscribe to this entry?

 
 [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

Pull Requests

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-2024 The PHP Group
All rights reserved.
Last updated: Tue Oct 08 11:01:27 2024 UTC