28898, "bradcray", "Add missing imag/complex '**' operators", "2026-05-27T21:09:40Z"
In discussing #28784, it was noted that we are missing ** overloads for the following cases, which reflect a certain lack of symmetry across types:
complex**intparam complex**param [int | complex][param] imag**anything- would we want to support
intandimagexponents here?
- would we want to support
For imaginary values, it was noted that those values could be upcast to complex and the complex ** overload could be used, but it also seemed probable that the implementation could be optimized for plain-old imag, knowing that its real component was 0.0, suggesting a separate overload.
That said, we also believe that it will need to return a complex since the result will be real or imaginary, but cannot be determined statically (_perhaps it could be for param**param cases, but we didn't want the return type to be dependent on the values passed in). Someone for whom complex exponentiation is more natural than it is for me/us should check our work here.