[squeak-dev] Re: Migrating Complex in a separate package
Juan Vuletich
juan at jvuletich.org
Tue Oct 11 13:48:07 UTC 2011
Ricardo Moran wrote:
>
> On Tue, Oct 11, 2011 at 9:51 AM, Juan Vuletich <juan at jvuletich.org
> <mailto:juan at jvuletich.org>> wrote:
>
> Juan Vuletich wrote:
>
> Hi Folks,
>
> Rodney Polkinghorne wrote:
>
> ...
>
> extra fact:
> - Complex is absent from Cuis
>
>
>
> Not for long :) . I have already integrated it and will be in
> next Cuis release. I think Complex belongs in the base system.
>
>
> Oh, forgot to say. I also think that
> -1 sqrt = 1i
> should be true, and I'm working on it (together with some other
> tweaks to #sqrt and friends I'll publish when finished).
>
>
> +1. I was just about to comment on that one :)
>
> It always bothered me that "-1 sqrt" wouldn't answer "1i". It seems
> like an incomplete implementation, being that we have the class Complex.
> At the time I "fixed" it by just relying on the fact that the sqrt
> primitive fails when the receiver is negative, but that solution seems
> very hackish. I wonder what your solution looks like? :)
>
> Cheers,
> Richo
I don't think it is hackish... It is the usual way for dealing with
cases the primitives can't deal. That's totally ok for me.
What I'm trying to fix is that '4 sqrt' and '8 raisedTo: 1/3' answer
Floats, when they should answer SmallIntegers.
Cheers,
Juan Vuletich
More information about the Squeak-dev
mailing list
|