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

< cpp‎ | numeric‎ | complex
Revision as of 23:15, 31 May 2013 by P12bot (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
template< class T >
complex<T> operator+( const complex<T>& val );
template< class T >
complex<T> operator-( const complex<T>& val );

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

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

[edit] Parameters

val - the complex number argument

[edit] Return value

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

[edit] See also

performs complex number arithmetics on two complex values or a complex and a scalar
(function template) [edit]