-
Notifications
You must be signed in to change notification settings - Fork 51
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
Conversation
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> { |
There was a problem hiding this comment.
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() |
There was a problem hiding this comment.
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.
Should be working now |
I repeat, now it should be working. |
Thanks! bors r+ |
Build succeeded |
Requires a new version of
num-traits
to be pushed.