Automatic Differentiation
 
Loading...
Searching...
No Matches

◆ copysign() [3/3]

template<typename T , typename U >
std::complex< T > stan::math::copysign ( const std::complex< T > &  x,
const std::complex< U > &  y 
)
inline

Return the complex number composed of the real and complex parts with signs copied from the real and complex parts of the first arguments to the real and complex parts of the second.

This is an overload of the standard libary copysign for complex numbers that will be used with argument-dependent lookup. Rather than using the standard library copysign, it uses copysign_non_zero, which does not change sign if the reference value is zero (-0.0 or 0.0).

Template Parameters
Tvalue type of first argument
Uvalue type of second argument
Parameters
[in]xfirst complex argument
[in]ysecond complex argument
Returns
copy of second argument, with components negated if necessary to match sign of first argument

Definition at line 72 of file copysign.hpp.