📄 complex.html
字号:
<PRE>template<class Ty> complex<Ty> <B>log10</B>(const complex<Ty>& left);</PRE><P>The function returns the base 10logarithm of <CODE>left</CODE>.The branch cuts are along the negative real axis.</P><H2><A NAME="norm"><CODE>norm</CODE></A></H2><PRE>template<class Ty> Ty <B>norm</B>(const complex<Ty>& left);</PRE><P>The function returns the squared magnitude of <CODE>left</CODE>.</P><H2><A NAME="operator!="><CODE>operator!=</CODE></A></H2><PRE>template<class Ty> bool <B>operator!=</B>(const complex<Ty>& left, const complex<Ty>& right);template<class Ty> bool <B>operator!=</B>(const complex<Ty>& left, const Ty& right);template<class Ty> bool <B>operator!=</B>(const Ty& left, const complex<Ty>& right);</PRE><P>The operators each return true only if<CODE><A HREF="#real">real</A>(left) != real(right) ||<A HREF="#imag">imag</A>(left) != imag(right)</CODE>.</P><H2><A NAME="operator*"><CODE>operator*</CODE></A></H2><PRE>template<class Ty> complex<Ty> <B>operator*</B>(const complex<Ty>& left, const complex<Ty>& right);template<class Ty> complex<Ty> <B>operator*</B>(const complex<Ty>& left, const Ty& right);template<class Ty> complex<Ty> <B>operator*</B>(const Ty& left, const complex<Ty>& right);</PRE><P>The operators each convert both operands to the return type,then return the complex productof the converted <CODE>left</CODE> and <CODE>right</CODE>.</P><H2><A NAME="operator+"><CODE>operator+</CODE></A></H2><PRE>template<class Ty> complex<Ty> <B>operator+</B>(const complex<Ty>& left, const complex<Ty>& right);template<class Ty> complex<Ty> <B>operator+</B>(const complex<Ty>& left, const Ty& right);template<class Ty> complex<Ty> <B>operator+</B>(const Ty& left, const complex<Ty>& right);template<class Ty> complex<Ty> <B>operator+</B>(const complex<Ty>& left);</PRE><P>The binary operators each convert both operands to the return type,then return the complex sumof the converted <CODE>left</CODE> and <CODE>right</CODE>.</P><P>The unary operator returns <CODE>left</CODE>.</P><H2><A NAME="operator-"><CODE>operator-</CODE></A></H2><PRE>template<class Ty> complex<Ty> <B>operator-</B>(const complex<Ty>& left, const complex<Ty>& right);template<class Ty> complex<Ty> <B>operator-</B>(const complex<Ty>& left, const Ty& right);template<class Ty> complex<Ty> <B>operator-</B>(const Ty& left, const complex<Ty>& right);template<class Ty> complex<Ty> <B>operator-</B>(const complex<Ty>& left);</PRE><P>The binary operators each convert both operands to the return type,then return the complex differenceof the converted <CODE>left</CODE> and <CODE>right</CODE>.</P><P>The unary operator returns a value whose real part is<CODE>-<A HREF="#real">real</A>(left)</CODE> and whose imaginary part is<CODE>-<A HREF="#imag">imag</A>(left)</CODE>.</P><H2><A NAME="operator/"><CODE>operator/</CODE></A></H2><PRE>template<class Ty> complex<Ty> <B>operator/</B>(const complex<Ty>& left, const complex<Ty>& right);template<class Ty> complex<Ty> <B>operator/</B>(const complex<Ty>& left, const Ty& right);template<class Ty> complex<Ty> <B>operator/</B>(const Ty& left, const complex<Ty>& right);</PRE><P>The operators each convert both operands to the return type,then return the complex quotientof the converted <CODE>left</CODE> and <CODE>right</CODE>.</P><H2><A NAME="operator<<"><CODE>operator<<</CODE></A></H2><PRE>template<class Ty, class Elem, class Tr> basic_ostream<Elem, Tr>& <B><A HREF="#operator<<">operator<<</A></B>(basic_ostream<Elem, Tr>& ostr, const complex<Ty>& right);</PRE><P>The template function inserts the complex value <CODE>right</CODE>in the output stream <CODE>os</CODE>, effectively by executing:</P><PRE>basic_ostringstream<Elem, Tr> osstr;osstr.flags(ostr.flags());osstr.imbue(ostr.imbue());osstr.precision(ostr.precision());osstr << '(' << real(right) << ',' << imag(right) << ')';ostr << osstr.str().c_str();</PRE><P>Thus, if<CODE>ostr.<A HREF="ios.html#ios_base::width">width</A>()</CODE> isgreater than zero, any padding occurs either before or after theparenthesized pair of values, which itself contains no padding.The function returns <CODE>ostr</CODE>.</P><H2><A NAME="operator=="><CODE>operator==</CODE></A></H2><PRE>template<class Ty> bool <B>operator==</B>(const complex<Ty>& left, const complex<Ty>& right);template<class Ty> bool <B>operator==</B>(const complex<Ty>& left, const Ty& right);template<class Ty> bool <B>operator==</B>(const Ty& left, const complex<Ty>& right);</PRE><P>The operators each return true only if<CODE><A HREF="#real">real</A>(left) == real(right) &&<A HREF="#imag">imag</A>(left) == imag(right)</CODE>.</P><H2><A NAME="operator>>"><CODE>operator>></CODE></A></H2><PRE>template<class Ty, class Elem, class Tr> basic_istream<Elem, Tr>& <B>operator>></B>(basic_istream<Elem, Tr>& istr, complex<Ty>& right);</PRE><P>The template function attempts to extract a complex valuefrom the input stream <CODE>istr</CODE>, effectively by executing:</P><PRE>istr >> ch && ch == '(' && istr >> re >> ch && ch == ',' && istr >> im >> ch && ch == ')'</PRE><P>Here, <CODE>ch</CODE> is an object of type <CODE>Elem</CODE>,and <CODE>re</CODE> and <CODE>im</CODE> are objects of type <CODE>Ty</CODE>.</P><P>If the result of this expression is true, the function stores<CODE>re</CODE> in the real part and <CODE>im</CODE> in theimaginary part of <CODE>right</CODE>. In any event, the functionreturns <CODE>istr</CODE>.</P><H2><A NAME="polar"><CODE>polar</CODE></A></H2><PRE>template<class Ty> complex<Ty> <B>polar</B>(const Ty& rho, const Ty& theta = 0);</PRE><P>The function returns the complex value whose magnitudeis <CODE>rho</CODE> and whose phase angle is <CODE>theta</CODE>.</P><H2><A NAME="pow"><CODE>pow</CODE></A></H2><PRE>template<class Ty> complex<Ty> <B>pow</B>(const complex<Ty>& left, int right);template<class Ty> complex<Ty> <B>pow</B>(const complex<Ty>& left, const Ty& right);template<class Ty> complex<Ty> <B>pow</B>(const complex<Ty>& left, const complex<Ty>& right);template<class Ty> complex<Ty> <B>pow</B>(const Ty& left, const complex<Ty>& right);</PRE><P>The functions each effectively convert both operands tothe return type, then return the converted<CODE>left</CODE> to the power <CODE>right</CODE>.The branch cut for <CODE>left</CODE> is along the negative real axis.</P><H2><A NAME="real"><CODE>real</CODE></A></H2><PRE>template<class Ty> Ty <B>real</B>(const complex<Ty>& left);</PRE><P>The function returns the real part of <CODE>left</CODE>.</P><H2><A NAME="sin"><CODE>sin</CODE></A></H2><PRE>template<class Ty> complex<Ty> <B>sin</B>(const complex<Ty>& left);</PRE><P>The function returns the sine of <CODE>left</CODE>.</P><H2><A NAME="sinh"><CODE>sinh</CODE></A></H2><PRE>template<class Ty> complex<Ty> <B>sinh</B>(const complex<Ty>& left);</PRE><P>The function returns the hyperbolic sine of <CODE>left</CODE>.</P><H2><A NAME="sqrt"><CODE>sqrt</CODE></A></H2><PRE>template<class Ty> complex<Ty> <B>sqrt</B>(const complex<Ty>& left);</PRE><P>The function returns the square root of <CODE>left</CODE>,with phase angle in the half-open interval <CODE>(-pi/2, pi/2]</CODE>.The branch cuts are along the negative real axis.</P><H2><A NAME="__STD_COMPLEX"><CODE>__STD_COMPLEX</CODE></A></H2><PRE>#define <B>__STD_COMPLEX</B></PRE><P>The macro is defined, with an unspecified expansion, to indicatecompliance with the specifications of this header.</P><H2><A NAME="tan"><CODE>tan</CODE></A></H2><PRE>template<class Ty> complex<Ty> <B>tan</B>(const complex<Ty>& left);</PRE><P>The function returns the tangent of <CODE>left</CODE>.</P><H2><A NAME="tanh"><CODE>tanh</CODE></A></H2><PRE>template<class Ty> complex<Ty> <B>tanh</B>(const complex<Ty>& left);</PRE><P>The function returns the hyperbolic tangent of <CODE>left</CODE>.</P><HR><P>See also the<B><A HREF="index.html#Table of Contents">Table of Contents</A></B> and the<B><A HREF="_index.html">Index</A></B>.</P><P><I><A HREF="crit_pjp.html">Copyright</A> © 1992-2002by P.J. Plauger. All rights reserved.</I></P><!--V4.01:1125--></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -