note 22552 added to language.types.float
| From: | niekomaatjes at hotmail dot com | Date: | Sat, 22 Jun 2002 12:13:48 +0000 |
| Subject: | note 22552 added to language.types.float | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-32102@lists.php.net to get a copy of this message | ||
If you'd want floor((0.1+0.7)*10) to return 8, you could add a real small fraction to it, like
this:
floor((0.1+0.7)*10 + 0.0000001)
This will usually return 8.
--
http://www.php.net/manual/en/language.types.float.php
http://master.php.net/manage/user-notes.php?action=edit+22552
http://master.php.net/manage/user-notes.php?action=delete+22552
http://master.php.net/manage/user-notes.php?action=reject+22552