mirror of
https://github.com/allankoechke/rust.git
synced 2026-12-01 01:26:32 +00:00
implement `Add` and `Sub` for `Complex` tracking issue: https://github.com/rust-lang/rust/issues/154023 Adds the `Add` and `Sub` implementations described in the tracking issue. Some notes - I also added a derive for `Eq`, which is useful for `Complex<{integer}>` - The versions that add/sub by a scalar need a `Copy` bound. That seems fine for most actual use cases. Apparently `num_complex` will `Clone` in these operations https://docs.rs/num-complex/latest/num_complex/struct.Complex.html#impl-Add%3CT%3E-for-%26Complex%3CT%3E, but that seems unlike `core` to me. Anyhow, libs can re-litigate that later.