Ken,

My concerns are not with the (representable) numbers in your tests; it is with 
the many numbers that do not have exact representations, and with those that 
will contain roundoff error.

Please note that I never called "What Every Computer Scientist Should Know 
About Floating-Point Arithmetic" trivial - in fact, I used the word non-trivial 
in connection with such things.

I gather that $< is very important to you.  What is so critical about it?  
There is probably a way to solve any problem you have without creating problems 
in the process, such as using a keyword message to do the comparison and 
keeping complex numbers separate from magnitudes.


"Do you really not believe that (0+0i) = 0 ??  Why, such numbers must be 
imaginary!!    ;^)"

Try 0+(0.1+0.1+0.1-0.3)i = 0.  Is it so clear now?  The zero imaginary part is 
simple for us, but not nearly so clear to a machine.

Bill



-----Original Message-----
From: [email protected] 
[mailto:[email protected]] On Behalf Of Ken.Dickey
Sent: Wednesday, August 12, 2009 4:00 PM
To: [email protected]
Subject: Re: [Pharo-project] Extending #< to compare all numbers

"Schwab,Wilhelm K" <[email protected]>
> Floating point is not always what it seems.

Hence my comment that IEEE floats get "the wrong answer fast".  I have used 
interval math, continued fractions, and linear fractional transforms (a.k.a. 
exact reals).  I agree that each representation has its challenges.

Let's talk for a second about integers.

 0 = (0+0i)   --> true
 1 = (1+0i)   --> true
 0 < 1           --> true
 (0+0i) < (1+0i)  --> ?? which answer here gives me the least surprise ??

To put it another way

(A = a)  --> true
(B = b)  --> true
(A < B) --> true
(a < b)  --> ?? what do you expect to see here ??

> By extension, I argue that
> computer-represented complex numbers are not always what they seem, 
> only more so.

Agreements: computers don't do math well.  Computers approximate math.  We 
would prefer to get the best approximations possible and be told when we are in 
deep waters.

There are math systems (e.g. using interval arithmetic) which either complain 
that they can't come up with a sensible answer (all the bits are roundoff
error) or go back and recompute with higher precision numeric representations 
in order to get X digits of correct precision.  

I am _not_ proposing to make Pharo into such a system.


> Intuition resulting from lots of exposure to mathematicians suggests 
> that they consider this non-trivial but well-known.

I don't consider "What Every Computer Scientist Should Know About 
Floating-Point Arithmetic" trivial -- especially for us non-mathematician users 
of numbers. [ http://docs.sun.com/source/806-3568/ncg_goldberg.html ]

> If I am reading this correctly, defining $< is making a promise we 
> can't keep, or perhaps we simply should not try.

Again, I am using unit tests as a fixed point.  

I want "if A=a and B=b and A<B then a<b" to work as I expect.  I consider 
anything else to be deeply broken.


> If you can find something that claims to produce a sensible ordering of
> complex numbers, please post a reference.  For now, my sense is that such a
> thing cannot exist.

I posted what I consider a sensible ordering which unit tests the property I 
care about.  It happens to be a total ordering (not that I really care).

I can certainly remove Complex>>< from the code, but I deeply dislike breaking 
basic logic on integers.  I would prefer to have something more meaningful 
than "mathematicians can't agree on a theoretical ordering of complex 
numbers, so practical logic must fail".

Do you really not believe that (0+0i) = 0 ??  Why, such numbers must be 
imaginary!!    ;^)

-KenD

_______________________________________________
Pharo-project mailing list
[email protected]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

_______________________________________________
Pharo-project mailing list
[email protected]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

Reply via email to