note 26887 deleted from language.operators.arithmetic by sniper
| From: | sniper@php.net | Date: | Mon, 13 Oct 2003 00:08:29 +0000 |
| Subject: | note 26887 deleted from language.operators.arithmetic by sniper | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-58387@lists.php.net to get a copy of this message | ||
Note Submitter: townsend1021@rogers.com
----
About the notes regarding rounding errors on floats close to integers...
Common mathematical understanding is that 0.999... (0.9 repeating) is actually 1. This is due to
the fact that 1 - 0.999... would be undefined if it wasn't considered zero. Therefore, almost
all programming languages out there (even those using big endian notation) will clean up anything
ending in .999... to the next integer value. I'd be interested to see any code that produces a
value with that decimal result. (Since when would 5 be stored as 4.9999? If you see 4.999, that
result didn't equal 5!)
AS SUCH, the FLOOR($a / $b) really should work just fine.
Again, if you can prove me wrong, please POST A COUNTER-EXAMPLE that disproves the above.