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

increment (+=) , decrement(-=), multiply(*=) and divide(/=) operations don't work #130

Open
kmolan opened this issue Jun 17, 2024 · 1 comment
Labels

Comments

@kmolan
Copy link

kmolan commented Jun 17, 2024

I'm using num-complex = version 0.4.6, and these kinds of operations is not yet supported:
`let mut var = T::one();

var += T::one();

var -= T::one();

var *= T::one();

var /= T::one();`

Now, this is easy to resolve if I change the above code to:
`let mut var = T::one();

var = var + T::one();

var = var - T::one();

var = var*T::one();

var = var/T::one();`

Still, it'd be nice to have this supported.

@cuviper
Copy link
Member

cuviper commented Jun 26, 2024

Are you using a generic T in your code? What type constraints do you have?

The implementation of these traits requires T: Clone + NumAssign, e.g. AddAssign<T> for Complex<T>.

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

No branches or pull requests

2 participants