public member function
<complex>
std::complex::imag get (1)T imag() const;set (2)
void imag (T val);
Imaginary part
Returns the imaginary part of the complex number.
Returns the imaginary part of the complex number (1), or sets val as the new value for the imaginary part (2).
i
) is multiplied.
A non-member function exists with the same name: imag.
T
is complex's template parameter.
1
2
3
4
5
6
7
8
9
10
11
12
// complex::imag example
#include <iostream> // std::cout
#include <complex> // std::complex
int main ()
{
std::complex<double> mycomplex (20.0,2.0);
std::cout << "Imaginary part: " << mycomplex.imag() << '\n';
return 0;
}
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4