At 11:24 AM +0100 7/15/08, Ford, Mike wrote:
On 14 July 2008 20:47, tedd advised:
> Round-off errors normally don't enter into things unless your doing
> multiplication and division operations. At that point, what you get
back from the operation is an approximation and not the actual
number.
Bull! Nearly all computer floating point numbers are approximations
because of being held in binary rather than decimal. Any number with a
(decimal) fractional part that doesn't end with the digit 5 is
necessarily an approximation, and that's only half the story. So as soon
as you involve numbers like 0.1 or 0.2, you've already got minor
inaccuracies which will propagate through any kind of arithmetic -- it's
just worse with multiplication or division because these tend to result
in inaccuracy in more significant digits!
Bottom line: a floating point value should *always* be treated with an
appropriate degree of suspicion.
Cheers!
Mike
Mike:
No reason to be rude.
I said:
"Round-off errors normally don't enter into things unless your doing
multiplication and division operations."
And that is not "Bull" -- it's true. You can add and subtract all the
floating point numbers (the one's we are talking about here) you want
without any rounding errors whatsoever.
Cheers,
tedd
--
-------
http://sperling.com http://ancientstones.com http://earthstones.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php