Title
std::atan2 and std::pow overloads that take two std::valarray parameters should require the arguments to have the same length
Status
new
Section
[valarray.transcend]
Submitter
Jiang An

Created on 2023-07-28.00:00:00 last changed 13 months ago

Messages

Date: 2023-10-30.16:39:42

Proposed resolution:

This wording is relative to N4950.

  1. Modify [valarray.transcend] as indicated:

    template<class T> valarray<T> abs (const valarray<T>&);
    template<class T> valarray<T> acos (const valarray<T>&);
    template<class T> valarray<T> asin (const valarray<T>&);
    template<class T> valarray<T> atan (const valarray<T>&);
    template<class T> valarray<T> atan2(const valarray<T>&, const valarray<T>&);
    template<class T> valarray<T> atan2(const valarray<T>&, const typename valarray<T>::value_type&);
    template<class T> valarray<T> atan2(const typename valarray<T>::value_type&, const valarray<T>&);
    template<class T> valarray<T> cos (const valarray<T>&);
    template<class T> valarray<T> cosh (const valarray<T>&);
    template<class T> valarray<T> exp (const valarray<T>&);
    template<class T> valarray<T> log (const valarray<T>&);
    template<class T> valarray<T> log10(const valarray<T>&);
    template<class T> valarray<T> pow (const valarray<T>&, const valarray<T>&);
    template<class T> valarray<T> pow (const valarray<T>&, const typename valarray<T>::value_type&);
    template<class T> valarray<T> pow (const typename valarray<T>::value_type&, const valarray<T>&);
    template<class T> valarray<T> sin (const valarray<T>&);
    template<class T> valarray<T> sinh (const valarray<T>&);
    template<class T> valarray<T> sqrt (const valarray<T>&);
    template<class T> valarray<T> tan (const valarray<T>&);
    template<class T> valarray<T> tanh (const valarray<T>&);
    

    -1- Mandates: A unique function with the indicated name can be applied (unqualified) to an operand of type T. This function returns a value of type T or which can be unambiguously implicitly converted to type T.

    -?- Preconditions: For atan2 and pow overloads that take two valarray parameters, the corresponding array arguments have the same length.

Date: 2023-10-15.00:00:00

[ 2023-10-30; Reflector poll ]

Set priority to 4 after reflector poll. "Also need to say what those functions return." "Paragraph 1 needs a correction for the functions that takes two operands." "And those are arguments not operands."

Date: 2023-07-28.00:00:00

All binary operation between std::valarrays expect them to have the same length. But std::atan2 and std::pow lack such Preconditions.

History
Date User Action Args
2023-10-30 16:39:42adminsetmessages: + msg13784
2023-07-29 16:07:50adminsetmessages: + msg13697
2023-07-28 00:00:00admincreate