PHP 4.0 Bug #9843 Updated: Decrement Operator

From: Date: Mon, 19 Mar 2001 19:56:55 +0000
Subject: PHP 4.0 Bug #9843 Updated: Decrement Operator
Groups: php.dev 
Request: Send a blank email to php-dev+get-49387@lists.php.net to get a copy of this message
ID: 9843 Updated by: hholzgra Reported By: jplock@bigfoot.com Old-Status: Open Status: Closed Bug Type: Scripting Engine problem Assigned To: Comments: theese are typical rounding errors that occure when dealing with decimal fractions on binary based machines Previous Comments: --------------------------------------------------------------------------- [2001-03-19 14:46:12] jplock@bigfoot.com I believe there is a problem with the decrement operator. http://www.artemisgroup.com/test.php $percentchange = .30; while ($percentchange > -1){ $percentchange -= .01; echo $percentchange; } zero is returned as -1.422473250301E-16 and 0.01 is returned as 0.0099999999999999. This seems incorrect to me. Thanks --------------------------------------------------------------------------- ATTENTION! Do NOT reply to this email! To reply, use the web interface found at http://bugs.php.net/?id=9843&edit=2

« previous php.dev (#49387) next »