|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #28536 Invalid Calculation: 90.99-90.00 = 0.98999999999999 ... when it should be 0.99
Submitted: 2004-05-26 22:04 UTC Modified: 2004-05-26 22:06 UTC
From: hart0550 at umn dot edu Assigned:
Status: Not a bug Package: Math related
PHP Version: 4.3.4 OS: Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
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:
Solve the problem:
39 - 5 = ?
Subscribe to this entry?

 [2004-05-26 22:04 UTC] hart0550 at umn dot edu
When calculating 90.99 minus 90.00 it returns 0.98999999999999 which is a bit big for a simple subtraction of two floats that only have 2 decimal numbers.

Reproduce code:

	$calc = 90.99 - 90.00;
	print $calc;


Expected result:

Actual result:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2004-05-26 22:06 UTC]
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at and the instructions on how to report
a bug at

Welcome to the world of floating point numbers.  This is 
how it works.
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Tue Feb 07 14:03:41 2023 UTC