#24891 [NEW]: Decimal equality incorrect result

From: Date: Thu, 31 Jul 2003 18:32:22 +0000
Subject: #24891 [NEW]: Decimal equality incorrect result
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-45126@lists.php.net to get a copy of this message
From: jeff at tmtrading dot com Operating system: Win2000 & RH Linux 8.0 PHP version: 4CVS-2003-07-31 (stable) PHP Bug Type: Scripting Engine problem Bug description: Decimal equality incorrect result Description: ------------ When I try to test equality using these numbers php incorrectly returns false. This is a serious problem as we are developing a e-cart in php. Reproduce code: --------------- $all = 0.92; $asum = 0.71; $bsum = 0.21; if($all == ($asum + $bsum)) { print "TRUE\n"; } else { print "FALSE\n"; } Expected result: ---------------- TRUE Actual result: -------------- FALSE -- Edit bug report at http://bugs.php.net/?id=24891&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=24891&r=trysnapshot4 Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=24891&r=trysnapshot5 Fixed in CVS: http://bugs.php.net/fix.php?id=24891&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=24891&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=24891&r=needtrace Try newer version: http://bugs.php.net/fix.php?id=24891&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=24891&r=support Expected behavior: http://bugs.php.net/fix.php?id=24891&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=24891&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=24891&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=24891&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=24891&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=24891&r=dst IIS Stability: http://bugs.php.net/fix.php?id=24891&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=24891&r=gnused

« previous php.bugs (#45126) next »