Namespaces
Variants
Views
Actions

std::real(std::complex)

From cppreference.com
< cpp‎ | numeric‎ | complex
Revision as of 14:44, 18 April 2013 by Cubbi (Talk | contribs)

 
 
 
 

Template:ddcl list begin <tr class="t-dsc-header">

<td>
Defined in header <complex>
</td>

<td></td> <td></td> </tr> <tr class="t-dcl ">

<td >
template< class T >
T real( const complex<T>& z );
</td>

<td > (1) </td> <td class="t-dcl-nopad"> </td> </tr> <tr class="t-dcl ">

<td >
std::complex<long double> real( long double z );
</td>

<td > (2) </td> <td > (since C++11) </td> </tr> <tr class="t-dcl ">

<td >
template< class DoubleOrIngeter >
std::complex<double> real( DoubleOrInteger z );
</td>

<td > (3) </td> <td > (since C++11) </td> </tr> <tr class="t-dcl ">

<td >
std::complex<float> real( float z );
</td>

<td > (4) </td> <td > (since C++11) </td> </tr> Template:ddcl list end

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

Template:cpp/numeric/complex/dcl list realTemplate:cpp/numeric/complex/dcl list imagTemplate:cpp/numeric/complex/dcl list imag2