Files
rust/library/coretests
Jonathan Brouwer 4011b08781 Rollup merge of #162865 - folkertdev:complex-conjugate, r=nia-e
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)
2026-09-17 16:50:59 +02:00
..
…