|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #44097 error with match
Submitted: 2008-02-11 10:29 UTC Modified: 2008-02-11 12:50 UTC
From: cristian at buttasi dot it Assigned:
Status: Not a bug Package: *Math Functions
PHP Version: 5.2.5 OS: Windows
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 this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: cristian at buttasi dot it
New email:
PHP Version: OS:


 [2008-02-11 10:29 UTC] cristian at buttasi dot it
i use php version 5.1.1

if i do : round(604.305,2) --->>> result 604.3
the corret value is 604.31
with same number round is correct but with this value is not correct

i hope that my note is important for us
excuse me for my bad english
bye, Cristian

Reproduce code:
echo round(604.305,2);

Expected result:

Actual result:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2008-02-11 12:50 UTC]
Floating point values have a limited precision. Hence a value might 
not have the same string representation after any processing. That also
includes writing a floating point value in your script and directly 
printing it without any mathematical operations.

If you would like to know more about "floats" and what IEEE
754 is, read this:
Thank you for your interest in PHP.

PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Feb 23 03:01:30 2024 UTC