note 26887 added to language.operators.arithmetic

From: Date: Sat, 16 Nov 2002 04:38:34 +0000
Subject: note 26887 added to language.operators.arithmetic
Groups: php.notes 
Request: Send a blank email to php-notes+get-39559@lists.php.net to get a copy of this message
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. -- http://www.php.net/manual/en/language.operators.arithmetic.php http://master.php.net/manage/user-notes.php?action=edit+26887 http://master.php.net/manage/user-notes.php?action=delete+26887 http://master.php.net/manage/user-notes.php?action=reject+26887

« previous php.notes (#39559) next »