|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #27332 wrong result
Submitted: 2004-02-20 10:43 UTC Modified: 2004-02-20 10:45 UTC
From: valeriy-v at yandex dot ru Assigned:
Status: Not a bug Package: Math related
PHP Version: 4.3.4 OS: windows xp
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.
Block user comment
Status: Assign to:
Bug Type:
From: valeriy-v at yandex dot ru
New email:
PHP Version: OS:


 [2004-02-20 10:43 UTC] valeriy-v at yandex dot ru
echo 22512.65+0-22511.03,'<br>';

will print 1.6200000000026

Reproduce code:
echo 22512.65+0-22511.03,'<br>';

Expected result:
wrong result 1.6200000000026

Actual result:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2004-02-20 10:45 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.
Thank you for your interest in PHP.

PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Jul 23 18:01:30 2024 UTC