Defined in header <complex> | ||
---|---|---|
(1) | ||
template< class T > T real( const std::complex<T>& z ); | (until C++14) | |
template< class T > constexpr T real( const std::complex<T>& z ); | (since C++14) | |
(2) | ||
float real( float z ); template< class DoubleOrInteger > double real( DoubleOrInteger z ); long double real( long double z ); | (since C++11) (until C++14) | |
constexpr float real( float z ); template< class DoubleOrInteger > constexpr double real( DoubleOrInteger z ); constexpr long double real( long double z ); | (since C++14) |
z
, i.e. z.real()
. 2) Additional overloads are provided for float , double , long double , and all integer types, which are treated as complex numbers with zero imaginary component. | (since C++11) |
z | - | complex value |
the real component of z
.
accesses the real part of the complex number (public member function) |
|
returns the imaginary component (function template) |
|
C documentation for creal |
© cppreference.com
Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0.
http://en.cppreference.com/w/cpp/numeric/complex/real2