#41733 [NEW]: float substraction doesn't return 0

From: Date: Mon, 18 Jun 2007 23:48:42 +0000
Subject: #41733 [NEW]: float substraction doesn't return 0
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-113912@lists.php.net to get a copy of this message
From: mc at glouglou dot net Operating system: Ubuntu PHP version: 5.2.3 PHP Bug Type: *Math Functions Bug description: float substraction doesn't return 0 Description: ------------ Came up with this numbers in a web-app. I've tested this on various platform (Linux/Windows) and PHP version 4.3.9, 5.1, 5.2.1 and 5.2.3 with default php.ini Reproduce code: --------------- <?php echo(859-832.35-26.65) ?> Expected result: ---------------- 0 Actual result: -------------- -2.13162820728E-14 -- Edit bug report at http://bugs.php.net/?id=41733&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=41733&r=trysnapshot44 Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=41733&r=trysnapshot52 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=41733&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=41733&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=41733&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=41733&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=41733&r=needscript Try newer version: http://bugs.php.net/fix.php?id=41733&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=41733&r=support Expected behavior: http://bugs.php.net/fix.php?id=41733&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=41733&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=41733&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=41733&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=41733&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=41733&r=dst IIS Stability: http://bugs.php.net/fix.php?id=41733&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=41733&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=41733&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=41733&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=41733&r=mysqlcfg

« previous php.bugs (#113912) next »