Igor Stasenko > P.S. diving into complex plane uncovers many potential pitfalls to those > who expecting a certain behavior of mathematical functions over a real > numbers. In first place square and square root. > It is good that with introduction of a complex numbers we can be sure that > x sqrt squared = x for any real x. > > The complex numbers gives us a impression that from now on, the square > function and squared root functions is reversable. But they are not for a > complex numbers. > In practice this means, that one, who using a complex math in his code, > should know well the properties of complex numbers, because this is not so > trivial as with real numbers & school algebra. And such people, basically > don't need the things with questionable or controversial behavior such as > #< operators on a complex plane. Then the aim of Complex package developer > should be to not introduce more confusion to people who is not using/learnt > the complex numbers, and leave attempts to help people who can - because > they could care for themselves well.
I guess here I go to high school physics, where electricity and magnetism use complex numbers and relativity uses hyperbolic trig. [Perhaps 1st year physics if your high school did not cover this]. My own experience is that adapting to floating point lossage was far more painful for me than learning 2d mathematics. Again, we can remove Complex totally and make that, hyperbolic trig, ln, and so forth into loadable packages. I would recommend that the error reports for sqrt and ln (if kept) of negative numbers make mention that a loadable package exists to give the expected functionality. A minimal base image (lacking even tools, perhaps even Morphic) is certainly useful in the build process at some point. I suspect there are those who would make such an image even smaller by removing fractions and perhaps even floats. My own preference is to leverage meta-programming aspects (traits, live code, intelligent toolsets) because I think that is where Pharo/Squeak excels. I am certainly happy to pay additional computational cost for better approximations to math (e.g. interval mathematics) because I like the system to tell me where the deep and shallow waters are. A factor of two or even ten slower sounds like a lot, but as speeds continue to double every 18 months, getting the right answers rather than "the wrong answer fast" is why one puts up with slower runtime systems. $0.02, -KenD PS: Thanks all for the helpful suggestions on tightening up the math. I will take a closer look at the branch cuts and so forth. _______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project