This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of CD1 status.
complex pow
return type is ambiguousSection: 29.4.10 [cmplx.over] Status: CD1 Submitter: Howard Hinnant Opened: 2008-06-03 Last modified: 2016-01-28
Priority: Not Prioritized
View all other issues in [cmplx.over].
View all issues with CD1 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
int
promotes todouble
, and C99 doesn't have anint
-based overload forpow
, the C99 result iscomplex<double>
, see also C99 7.22, see also library issue 550(i).Special note: ask P.J. Plauger.
Looks fine.
Proposed resolution:
Strike this pow
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);