Namespaces
Variants
Views
Actions

std::real(std::complex)

From cppreference.com
< cpp‎ | numeric‎ | complex
Revision as of 15:41, 1 July 2013 by P12bot (Talk | contribs)

Defined in header <complex>
template< class T >
T real( const complex<T>& z );
(1)
long double real( long double z );
(2) (since C++11)
template< class DoubleOrIngeter >
double real( DoubleOrInteger z );
(3) (since C++11)
float real( float z );
(4) (since C++11)

Returns the real component of the complex number z, i.e. z.real().

(since C++11)Additional overloads are provided for float, double, long double, and all integer types, which are treated as complex numbers with zero imaginary component.

Parameters

z - complex value

Return value

the real component of z

See also

accesses the real part of the complex number
(public member function) [edit]
accesses the imaginary part of the complex number
(public member function) [edit]
returns the imaginary component
(function template) [edit]