-
Notifications
You must be signed in to change notification settings - Fork 50
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 Pow for Complex #18
Comments
There is the issue of raising a
If |
@shingtaklam1324 right, but returning the principal solution is usually what people want. It's like how Complex numbers work similarly; solutions can be obtained by repeatedly multiplying a constant complex number, which I don't recall the equation for off the top of my head. The point is that the principal solution is 99% of the time what you want. I mean, in theory you could return an iterator over the solutions because they're countable, but I don't know if that's appropriate outside of niche cases. |
FWIW, we do already have |
@clarcharr I think I may have over complicated this slightly, in that case, it should just be a simple refactoring or having a wrapper function for impl Pow<Complex<T>> for Complex<T>
where T: Float + Clone and impl Pow<T> for Complex<T>
where T: Float + Clone |
Yes, I would just wrap |
Floats currently support ints and floats as exponents so I'd do all three for |
Yields: |
56: Add Complex::powi and assorted Pow impls r=cuviper a=cuviper Closes #18. Co-authored-by: Josh Stone <[email protected]>
See rust-num/num-traits#38 for details on this trait.
The text was updated successfully, but these errors were encountered: