2009/8/12 Ken.Dickey <[email protected]>: > "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 ?? >
Let me extend your test a little i do expect that, if : a < b and 0 < x then a*x < b*x now lets pick a = 1i, b = 2i , x = 1i. a <b -> returns true, good! 0 < x -> also returns true, good! now what about: a*x < b*x ? 1i*1i < 2i*1i ==> -1 < -2 -- what is a _least_ surprising answer of this expression? >> 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 > -- Best regards, Igor Stasenko AKA sig. _______________________________________________ Pharo-project mailing list [email protected] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
