This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of NAD status.

213. Math function overloads ambiguous

Section: 28.7 [c.math] Status: NAD Submitter: Nico Josuttis Opened: 2000-02-26 Last modified: 2016-01-28

Priority: Not Prioritized

View all other issues in [c.math].

View all issues with NAD status.

Discussion:

Due to the additional overloaded versions of numeric functions for float and long double according to Section 26.5, calls such as int x; std::pow (x, 4) are ambiguous now in a standard conforming implementation. Current implementations solve this problem very different (overload for all types, don't overload for float and long double, use preprocessor, follow the standard and get ambiguities).

This behavior should be standardized or at least identified as implementation defined.

Rationale:

These math issues are an understood and accepted consequence of the design. They have been discussed several times in the past. Users must write casts or write floating point expressions as arguments.