std::complex<T>:: operator+ (unary) , operator- (unary)
From cppreference.com
C++
Numerics library
| Common mathematical functions | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Mathematical special functions (C++17) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Mathematical constants (C++20) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Basic linear algebra algorithms (C++26) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Data-parallel types (
simd
)
(C++26)
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Floating-point environment (C++11) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Complex numbers | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Numeric array (
valarray
)
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Pseudo-random number generation | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Factor operations | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Interpolations | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Saturation arithmetic | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Generic numeric operations | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Bit operations | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
std::complex
| Member functions | ||||||||||||||||||||||||||
| Non-member functions | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
| Exponential functions | ||||||||||||||||||||||||||
| Power functions | ||||||||||||||||||||||||||
| Trigonometric functions | ||||||||||||||||||||||||||
| Hyperbolic functions | ||||||||||||||||||||||||||
| Helper types | ||||||||||||||||||||||||||
|
(C++26)
|
||||||||||||||||||||||||||
|
(C++26)
|
||||||||||||||||||||||||||
| (1) | ||
|
template
<
class
T
>
std:: complex < T > operator + ( const std:: complex < T > & val ) ; |
(until C++20) | |
|
template
<
class
T
>
constexpr std:: complex < T > operator + ( const std:: complex < T > & val ) ; |
(since C++20) | |
| (2) | ||
|
template
<
class
T
>
std:: complex < T > operator - ( const std:: complex < T > & val ) ; |
(until C++20) | |
|
template
<
class
T
>
constexpr std:: complex < T > operator - ( const std:: complex < T > & val ) ; |
(since C++20) | |
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,
std::
complex
<
T
>
(
val
)
2)
negated argument,
std::
complex
<
T
>
(
-
val.
real
(
)
,
-
val.
imag
(
)
)
See also
|
performs complex number arithmetic on two complex values or a complex and a scalar
(function template) |
Retrieved from "
https://en.cppreference.com/mwiki/index.php?title=cpp/numeric/complex/operator_arith2&oldid=138927
"