On Saturday, March 30, 2002, at 04:28 AM, Michael D Mays wrote:

> What is 1/3? it is 0.333333... Now pick a precision. Let's keep 10 
> digits
> after the decimal. So 1/3 is 0.3333333333.

> Its not the damn computer. Its those name numbers. :)

You are right.

If we used rational numbers as our numerals, this particular 
problem would not occur.

However, most of us have had to face rounding in decimal notation 
from elementary school.  We know what happens in this kind of 
arithmetic.  In keeping the number of concepts down, we can borrow 
those already established.

Moreover, this is a problem that does not occur in addition and 
subtraction.  (The above example involves division.)

As the engine currently is, this code creates a confusing situation:

on mouseUp
   put "235.00" into var
   repeat for 100 times
     put var + "0.01" into var
   end repeat
   Put var = "236.00" into field "Report"
end mouseUp

This reports "false" due to accumulated error in the representation 
of .01.

The problem is worse.  Try (empty & var) = "236.00".  true.  Or 
(empty & var) = var.  false.

That means empty is not the identity under &, which I find disturbing.

Dar Scott



_______________________________________________
improve-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/improve-revolution

Reply via email to