note 84552 deleted from function.ceil by danbrown

From: Date: Sat, 19 Jul 2008 15:05:29 +0000
Subject: note 84552 deleted from function.ceil by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-141696@lists.php.net to get a copy of this message
Note Submitter: Blaizer Reason: bad code ---- @ InsideR() If you echo 100 * 0.005 the output is, and has always been 55. Try it yourself. I'm with Zariok, there is a definite problem with ceil(). It should be noted that when using ceil for simple numbers that you know are always going to return correctly, ceil is the way to go. But when you let the user input numbers or when you know you're dealing with numbers like 0.5500 for example you use a function like the below one as an alternative.

« previous php.notes (#141696) next »