mirror of
https://github.com/allankoechke/rust.git
synced 2026-12-04 09:44:40 +00:00
Complex conjugate, negation and default tracking issue: https://github.com/rust-lang/rust/issues/154023 Add several more straightforward (I hope) impls and methods to `Complex`. - `Default` when `T: Default`. For numbers this means `Complex::default` is the unit element with respect to complex addition - `Neg` when `T: Neg`. Maps `a + bi` to `-a - bi`, which can underflow on integers (but this is no different from addition being able to overflow/underflow too - `conjugate` maps `a + bi` to `a - bi` - make `Complex::new` a `const fn`, because why not Complex division and multiplication is in progress in https://github.com/rust-lang/rust/pull/162832. r? @nia-e for continuity (or `r? libs` if you're busy)