This page is a snapshot from the LWG issues list, see theLibrary Active Issues List for more information and the meaning ofCD1 status.
complex pow return type is ambiguousSection: 29.4.10[cmplx.over]Status:CD1Submitter: Howard HinnantOpened: 2008-06-03Last modified: 2016-01-28
Priority:Not Prioritized
View all otherissues in [cmplx.over].
View all issues withCD1 status.
Discussion:
The current working draft is in an inconsistent state.
29.4.8[complex.transcendentals] says that:
pow(complex<float>(), int())returns acomplex<float>.
29.4.10[cmplx.over] says that:
pow(complex<float>(), int())returns acomplex<double>.
[Sophia Antipolis:]
Since
intpromotes todouble, and C99 doesn't have anint-basedoverload forpow, the C99 result iscomplex<double>, see also C997.22, see also library issue550(i).Special note: ask P.J. Plauger.
Looks fine.
Proposed resolution:
Strike thispow overload in 29.4.2[complex.syn] and in 29.4.8[complex.transcendentals]:
template<class T> complex<T> pow(const complex<T>& x, int y);