|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #15948 Basic Subtraction Error
Submitted: 2002-03-08 02:06 UTC Modified: 2002-03-08 02:36 UTC
From: abuckner at cicadadesign dot com Assigned:
Status: Not a bug Package: *Math Functions
PHP Version: 4.0.6 OS: Red Hat Linux 7.1
Private report: No CVE-ID: None
 [2002-03-08 02:06 UTC] abuckner at cicadadesign dot com
This was submitted by one of our head developers.  We're using PHP/MySQL to build our customer relationship software, and this scares me.


The numbers should add to 0. When I echo the result I get the below:



echo 241.20 + 169.23 - 410.43;



Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2002-03-08 02:36 UTC]
This is actually not a bug, but a normal thing with floatingpoint numbers. If you want to do precise calculating, use cents, or decrease the precision in php.ini from 14 to something like 10.

PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu May 23 03:01:28 2024 UTC