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

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: Sun Dec 22 06:01:30 2024 UTC