num-complex icon indicating copy to clipboard operation
num-complex copied to clipboard

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

Open kmolan opened this issue 1 year ago • 1 comments

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.

kmolan avatar Jun 17 '24 17:06 kmolan

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>.

cuviper avatar Jun 26 '24 22:06 cuviper