Hi guys What I would love is the following: that we get a good Complex package! Since we can do method extensions in Smalltalk we can design a really nice Complex packages with its own tests. We could publish for now Complex into PharoTaskForces or create a PharoExternalPackages or whatever. What do you think? Stef
On Aug 12, 2009, at 1:49 AM, Ken.Dickey wrote: > Q: What is the difference between a neurotic and a psychotic? > A: A psychotic really thinks 2+2 = 5 > A neurotic knows 2+2 = 4, but just can't stand it. ;^) > > I really can't stand some of the oddities of Complex numbers in Squeak > [Note Mantis bug 311 -- http://bugs.squeak.org/view.php?id=3311]. > > I would find the following to be more rational: > > 3 asComplex. "no change--> (3+0i)" > 3 asComplex isNumber. "no change--> true" > -1 asComplex < 1 asComplex. "--> true" > -4 sqrt. "--> 2.0i" > -3 ln. "--> (1.098612288668382+3.141592653589793i)" > ((1/2) + 2.1i) sin arcSin. "--> (0.500000000000001+2.1i)" > ((((1/2) + 2.1i) sin arcSin) roundTo: 0.000001) = ((1/2) + 2.1i). > "--> true" > ((((1/2) + 2.1i) tanH arcTanH) roundTo: 0.000001) = ((1/2) + 2.1i). > "--> true" > > Attached is a change set which adds a number of tests for Complex > and the > changes for Complex which allow those tests to pass in Pharo1.0beta > update: > #10413. Note that Complex becomes a subclass of Magnitude. > > I thought it would be useful to post the code first for your > thoughts and any > code cleanups. As an occasional Smalltalk user, you may wish to > correct some > of my idioms. Please forgive an old newbie. > > Thanks in advance, > -KenD [ken.dic...@whidbey.com] > > PS: Yes this is MIT. I signed and sent in the copyright form.. > <NeoComplex.1.cs>_______________________________________________ > Pharo-project mailing list > Pharo-project@lists.gforge.inria.fr > http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project _______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project