|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #30191 sum error
Submitted: 2004-09-22 06:24 UTC Modified: 2004-09-22 08:09 UTC
From: roberto at spadim dot com dot br Assigned:
Status: Not a bug Package: *Math Functions
PHP Version: 5.0.1 OS: linux, 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: roberto at spadim dot com dot br
New email:
PHP Version: OS:


 [2004-09-22 06:24 UTC] roberto at spadim dot com dot br
sum error: 

Reproduce code:
	echo 590-589.99;
	echo "\n";
	echo (double)(590)-(double)(589.99);	

Expected result:

Actual result:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2004-09-22 08:09 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-2023 The PHP Group
All rights reserved.
Last updated: Sun Jun 04 08:03:42 2023 UTC