Re: Bug #2835 Updated: floor (8.28 * 100) = 8.27

From: Date: Thu, 01 Jan 1970 00:00:00 +0000
Subject: Re: Bug #2835 Updated: floor (8.28 * 100) = 8.27
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-13149@lists.php.net to get a copy of this message
> 2. The float number was printed out as "828" and not as > "827.99999999999999999". > So there must be an explizit float conversion, which does > it "right". 827.9999999999999999999999999 == 828.000000 with 6 digit precision. > 3. Ok, I understand, why round(9.5) is not 10, > but every simple pocket calculator does this simple > thing "right". How many pocket calculators have a round() function? In order to ensure accuracy to a given precision when it comes to rounding/truncation you really need to supply this precision yourself. -Rasmus

« previous php.dev (#13149) next »