Bug #15756: bad Subtraction

From: Date: Wed, 27 Feb 2002 09:47:38 +0000
Subject: Bug #15756: bad Subtraction
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-1184@lists.php.net to get a copy of this message
From: jjulio@post.sk Operating system: linux PHP version: 4.0.6 PHP Bug Type: *General Issues Bug description: bad Subtraction When i use this code: <? echo 120-119.1."\n"; echo 120-119.2."\n"; echo 120-119.3."\n"; echo 120-119.4."\n"; echo 120-119.5."\n"; echo 120-119.6."\n"; echo 120-119.7."\n"; echo 120-119.8."\n"; echo 120-119.9."\n"; ?> or with variables...results was: 0.90000000000001 0.8 0.7 0.59999999999999 0.5 0.40000000000001 0.3 0.2 0.099999999999994 Is it correct or no? How can i get correct results without using round()??? -- Edit bug report at http://bugs.php.net/?id=15756&edit=1 -- Fixed in CVS: http://bugs.php.net/fix.php?id=15756&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=15756&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=15756&r=needtrace Try newer version: http://bugs.php.net/fix.php?id=15756&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=15756&r=support Expected behavior: http://bugs.php.net/fix.php?id=15756&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=15756&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=15756&r=submittedtwice

« previous php.bugs (#1184) next »