Difference between revisions of "cpp/numeric/complex/real2"
From cppreference.com
(additional overloads return type correction) |
m (Shorten template names. Use {{lc}} where appropriate.) |
||
Line 1: | Line 1: | ||
{{cpp/title|real{{small|(std::complex)}}}} | {{cpp/title|real{{small|(std::complex)}}}} | ||
{{cpp/numeric/complex/navbar}} | {{cpp/numeric/complex/navbar}} | ||
− | {{ | + | {{dcl begin}} |
− | {{ | + | {{dcl header | complex}} |
− | {{ | + | {{dcl | num=1 | 1= |
template< class T > | template< class T > | ||
T real( const complex<T>& z ); | T real( const complex<T>& z ); | ||
}} | }} | ||
− | {{ | + | {{dcl | num=2 | notes={{mark since c++11}} | 1= |
long double real( long double z ); | long double real( long double z ); | ||
}} | }} | ||
− | {{ | + | {{dcl | num=3 | notes={{mark since c++11}} | 1= |
template< class DoubleOrIngeter > | template< class DoubleOrIngeter > | ||
double real( DoubleOrInteger z ); | double real( DoubleOrInteger z ); | ||
}} | }} | ||
− | {{ | + | {{dcl | num=4 | notes={{mark since c++11}} | 1= |
float real( float z ); | float real( float z ); | ||
}} | }} | ||
− | {{ | + | {{dcl end}} |
Returns the real component of the complex number {{tt|z}}, i.e. {{c|z.real()}}. | Returns the real component of the complex number {{tt|z}}, i.e. {{c|z.real()}}. | ||
Line 24: | Line 24: | ||
===Parameters=== | ===Parameters=== | ||
− | {{ | + | {{par begin}} |
− | {{ | + | {{par | z | complex value}} |
− | {{ | + | {{par end}} |
===Return value=== | ===Return value=== | ||
Line 33: | Line 33: | ||
===See also=== | ===See also=== | ||
− | {{ | + | {{dsc begin}} |
− | {{ | + | {{dsc inc | cpp/numeric/complex/dcl list real}} |
− | {{ | + | {{dsc inc | cpp/numeric/complex/dcl list imag}} |
− | {{ | + | {{dsc inc | cpp/numeric/complex/dcl list imag2}} |
− | {{ | + | {{dsc end}} |
[[de:cpp/numeric/complex/real2]] | [[de:cpp/numeric/complex/real2]] |
Revision as of 19:18, 31 May 2013
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