Namespaces
Variants
Views
Actions

std::complex::operator+(unary), operator-(unary)

From cppreference.com
< cpp‎ | numeric‎ | complex
Revision as of 23:49, 2 November 2012 by P12bot (Talk | contribs)

Template:ddcl list begin <tr class="t-dcl ">

<td >
template< class T >
complex<T> operator+( const complex<T>& val );
</td>

<td > (1) </td> <td class="t-dcl-nopad"> </td> </tr> <tr class="t-dcl ">

<td >
template< class T >
complex<T> operator-( const complex<T>& val );
</td>

<td > (2) </td> <td class="t-dcl-nopad"> </td> </tr> Template:ddcl list end

Implements the analogs of the unary arithmetic operators for complex numbers.

1) Returns the value of its argument
2) Negates the argument

Parameters

val - the complex number argument

Return value

1) a copy of the argument, complex<T>(val)
2) negated argument, complex<T>(-val.real(), -val.imag())

See also

Template:cpp/numeric/complex/dcl list operator arith3