Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

numeric types need "conjugate" operator #33

Closed
coke opened this issue Mar 28, 2013 · 3 comments
Closed

numeric types need "conjugate" operator #33

coke opened this issue Mar 28, 2013 · 3 comments

Comments

@coke
Copy link
Contributor

coke commented Mar 28, 2013

Originally entered by Dave Whipp as https://rt.perl.org/rt3/Ticket/Display.html?id=76602

I was looking at colomon's Vector.pm in github, and noticed that
Vector::length is defined as { sqrt( self dot self ) }. This is
obviously incorrect for complex numbers: it should be { sqrt( self dot
conjugate self ) } (for some syntax of "conjugate")

I can't just add the method to the Complex class, because then the
Vector code would fail ("method not found") for all non-complex
numeric types (for which conjugation is an identity operation).

@colomon
Copy link
Contributor

colomon commented Mar 29, 2013

Seems reasonable to me. I have to admit I thought complex conjugate was already in there. I will take a stab at it after rehearsal tonight if no one beats me to it.

@dwhipp
Copy link
Contributor

dwhipp commented Mar 29, 2013

Yes, I added it to Rakudo a couple of years back ... not sure if it made it
to the spec.
rakudo/rakudo@cd1154b

On Thu, Mar 28, 2013 at 5:14 PM, colomon notifications@github.com wrote:

Seems reasonable to me. I have to admit I thought complex conjugate was
already in there. I will take a stab at it after rehearsal tonight if no
one beats me to it.


Reply to this email directly or view it on GitHubhttps://github.com//issues/33#issuecomment-15622833
.

@leto
Copy link

leto commented Mar 29, 2013

+1

@colomon
Copy link
Contributor

colomon commented Mar 29, 2013

Complex conjugate is already in there, as conj. It was also as conjugate in one place, I have corrected that. I'm working on updating Math:: Vector, and may add a few additional tests to roast as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants