At 08:20 PM Friday 9/22/2006, Charlie Bell wrote:
On 23/09/2006, at 1:11 AM, Klaus Stock wrote:
OTOH, consider the following Smalltalk code:
x := 1 / 3.
x := 3 * x.
x inspect.
Common sense tells us that the result is 0.9999999 - but Smalltalk
insists
on 1.
Um, .9* *is* 1.
.9999999... is equal to 1. (infinite string of 9s)
.9999999 is not equal to 1. (finite string of 9s)
As I said earlier, computers represent numbers with a finite number
of digits, which causes round-off errors, which can grow when the
result of one calculation is used in another calculation. Especially
when you subtract two nearly equal numbers.
-- Ronn! :)
_______________________________________________
http://www.mccmedia.com/mailman/listinfo/brin-l