PHP 4.0 Bug #6220: floor((0.7+0.1)*10) wrong

From: Date: Thu, 17 Aug 2000 16:23:13 +0000
Subject: PHP 4.0 Bug #6220: floor((0.7+0.1)*10) wrong
Groups: php.dev 
Request: Send a blank email to php-dev+get-29307@lists.php.net to get a copy of this message
From: rockojfonzo@gmx.net Operating system: MacOS X Server PHP version: 4.0.1pl2 PHP Bug Type: Misbehaving function Bug description: floor((0.7+0.1)*10) wrong with the argument "(0.7+0.1)*10" resulting in "8" floor() returns 7. Huh? For other values it´s okay. $result1=(((0.7+0.1)*10)); echo "Result 1 ((0.7+0.1)*10): $result1 = OK!<BR>"; $result2=floor( $result1); echo "Result 2 (floor(result1)): $result2, should be 8, too<BR>"; $result3=floor((0.7+0.1)*10)/10; echo "Result 3 (floor((0.7+0.1)*10)/10): $result3*"; ./configure --with-mysql --with-apxs It was the same with PHP3, that´s why I upgraded to Version 4.

« previous php.dev (#29307) next »