1435. Unclear returns specifications for C99 complex number functions

Section: 29.5.7 [complex.value.ops] Status: C++11 Submitter: BSI Opened: 2010-08-25 Last modified: 2016-02-10

Priority: Not Prioritized

View all other issues in [complex.value.ops].

View all issues with C++11 status.

Discussion:

Addresses GB-120

The complex number functions added for compatibility with the C99 standard library are defined purely as a cross-reference, with no hint of what they should return. This is distinct from the style of documentation for the functions in the earlier standard. In the case of the inverse-trigonometric and hyperbolic functions, a reasonable guess of the functionality may be made from the name, this is not true of the cproj function, which apparently returns the projection on the Reimann Sphere. A single line description of each function, associated with the cross-reference, will greatly improve clarity.

[2010-11-06 Beman provides proposed resolution wording.]

[ 2010 Batavia: The working group concurred with the issue's Proposed Resolution ]

[ Adopted at 2010-11 Batavia ]

Proposed resolution:

Change 26.4.7 complex value operations [complex.value.ops] as indicated:

template<class T> complex<T> proj(const complex<T>& x);

Returns: the projection of x onto the Riemann sphere.

Effects: Remarks: Behaves the same as the C function cproj, defined in 7.3.9.4.

Change 26.4.8 complex transcendentals [complex.transcendentals] as indicated:

template<class T> complex<T> acos(const complex<T>& x);

Returns:  the complex arc cosine of x.

Effects: Remarks: Behaves the same as the C function cacos, defined in 7.3.5.1.

Change 26.4.8 complex transcendentals [complex.transcendentals] as indicated:

template<class T> complex<T> asin(const complex<T>& x);

Returns:  the complex arc sine of x.

Effects: Remarks: Behaves the same as the C function casin, defined in 7.3.5.2.

Change 26.4.8 complex transcendentals [complex.transcendentals] as indicated:

template<class T> complex<T> atan(const complex<T>& x);

Returns:  the complex arc tangent of x.

Effects: Remarks: Behaves the same as the C function catan, defined in 7.3.5.3.

Change 26.4.8 complex transcendentals [complex.transcendentals] as indicated:

template<class T> complex<T> acosh(const complex<T>& x);

Returns:  the complex arc hyperbolic cosine of x.

Effects: Remarks: Behaves the same as the C function cacosh, defined in 7.3.6.1.

Change 26.4.8 complex transcendentals [complex.transcendentals] as indicated:

template<class T> complex<T> asinh(const complex<T>& x);

Returns:  the complex arc hyperbolic sine of x.

Effects: Remarks: Behaves the same as the C function casinh, defined in 7.3.6.2.

Change 26.4.8 complex transcendentals [complex.transcendentals] as indicated:

template<class T> complex<T> atanh(const complex<T>& x);

Returns:  the complex arc hyperbolic tangent of x.

Effects: Remarks: Behaves the same as the C function catanh, defined in 7.3.6.2.