Hi,
OK, I'm totally stumped by this. This should be the simplest math imaginable (addition and subtraction), but PHP is coming up with the wrong answer!
[snip] Is this legitimately bad math on the part of PHP?
Thanks, Brian
This is a flaw in how computers handle floating point numbers, not php. As the memory needed to store exact floats to any useful precision would quickly get out of control, floats are handled inprecisely. As a result, you should never test for equality with a float, but rather check if the float is within a certain range of the desired number.
-- Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
http://www.smempire.org
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php