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

Implement is_one and Inv for Complex. #17

Merged
merged 3 commits into from
Mar 5, 2018
Merged

Implement is_one and Inv for Complex. #17

merged 3 commits into from
Mar 5, 2018

Conversation

clarfonthey
Copy link
Contributor

Requires a new version of num-traits to be pushed.

@cuviper
Copy link
Member

cuviper commented Mar 1, 2018

This should be good with a bump to num-traits 0.2.1.

src/lib.rs Outdated
@@ -664,6 +664,24 @@ impl<'a, T: Clone + Num + Neg<Output = T>> Neg for &'a Complex<T> {
}
}

impl<T: Clone + Num + Inv<Output = T>> Inv for Complex<T> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we need T: Inv, but we do need T: Neg for the inherent fn inv.


#[inline]
fn inv(self) -> Complex<T> {
self.inv()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure, but you might have to make this explicitly (&self).inv() to avoid recursion.

@clarfonthey clarfonthey changed the title Implement is_one for Complex. Implement is_one and Inv for Complex. Mar 4, 2018
@clarfonthey
Copy link
Contributor Author

Should be working now

@clarfonthey
Copy link
Contributor Author

I repeat, now it should be working.

@cuviper
Copy link
Member

cuviper commented Mar 5, 2018

Thanks!

bors r+

bors bot added a commit that referenced this pull request Mar 5, 2018
17: Implement is_one and Inv for Complex. r=cuviper a=clarcharr

Requires a new version of `num-traits` to be pushed.
@bors
Copy link
Contributor

bors bot commented Mar 5, 2018

Build succeeded

@bors bors bot merged commit 02c2c90 into rust-num:master Mar 5, 2018
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

Successfully merging this pull request may close these issues.

2 participants