📄 complex_.gml
字号:
:SNPF index='operator -='.Complex &.Complex::operator -=( Complex const &.num );
:SNPF index='operator -='.Complex &.Complex::operator -=( double num );
:eSNPL.
:SMTICS.
The &fn. is used to subtract
:ARG.num
from the value of the &obj.:PERIOD.
The second form of the &fn. subtracts
:ARG.num
from the real component of the *obj.:PERIOD.
:INCLUDE file='cpx_asgn'.
:RSLTS.
The &fn. returns a reference to the target of the assignment.
:SALSO.
:SAL typ='fun'.operator~b-
:SAL typ='mfun'.operator~b*=
:SAL typ='mfun'.operator~b+=
:SAL typ='mfun'.operator~b-
:SAL typ='mfun'.operator~b/=
:SAL typ='mfun'.operator~b=
:eSALSO.
:eLIBF.
:CMT.========================================================================
:LIBF fmt='fun'.operator /
:SNPL.
:SNPFLF .#include <complex.h>
:SNPR index='operator /'.Complex operator /( Complex const &.num1,
:SNPFLF . Complex const &.num2 );
:SNPR index='operator /'.Complex operator /( Complex const &.num1,
:SNPFLF . double num2 );
:SNPR index='operator /'.Complex operator /( double num1,
:SNPFLF . Complex const &.num2 );
:eSNPL.
:SMTICS.
The &fn. is used to divide
:ARG.num1
by
:ARG.num2
yielding a &obj.:PERIOD.
:P.
The first &fn. divides two &obj.s.
:P.
The second &fn. divides a &obj. by a floating-point value. In effect, the
real and imaginary components of the complex number are divided by the
floating-point value.
:P.
The third &fn. divides a floating-point value by a &obj.:PERIOD.
Conceptually, the
floating-point value is converted to a &obj. and then the division is done.
:INCLUDE file='cpx_op'.
:RSLTS.
The &fn. returns a &obj. that is the quotient of
:ARG.num1
divided by
:ARG.num2
:PERIOD.
:SALSO.
:SAL typ='fun'.operator~b*
:SAL typ='fun'.operator~b+
:SAL typ='fun'.operator~b-
:SAL typ='mfun'.operator~b/=
:eSALSO.
:eLIBF.
:CMT.========================================================================
:LIBF fmt='mfun' prot='public'.operator /=
:SNPL.
:SNPFLF .#include <complex.h>
:SNPFLF .public:
:SNPF index='operator /='.Complex &.Complex::operator /=( Complex const &.num );
:SNPF index='operator /='.Complex &.Complex::operator /=( double num );
:eSNPL.
:SMTICS.
The &fn. is used to divide the &obj. by
:ARG.num
:PERIOD.
The second form of the &fn. divides the real and imaginary
components of the &obj. by
:ARG.num
:PERIOD.
:INCLUDE file='cpx_asgn'.
:RSLTS.
The &fn. returns a reference to the target of the assignment.
:SALSO.
:SAL typ='fun'.operator~b/
:SAL typ='mfun'.operator~b*=
:SAL typ='mfun'.operator~b+=
:SAL typ='mfun'.operator~b-=
:SAL typ='mfun'.operator~b=
:eSALSO.
:eLIBF.
:CMT.========================================================================
:LIBF fmt='fun'.operator <<
:SNPL.
:SNPFLF .#include <complex.h>
:SNPR index='operator <<'.friend ostream &.operator <<( ostream &.strm, Complex &.num );
:eSNPL.
:SMTICS.
The &fn. is used to write &obj.s to an I/O stream.
The &obj. is always written in the form:
:P.
:MONO.(real,imag)
:P.
The real and imaginary components are written using the normal rules for
formatting floating-point numbers.
Any formatting options specified prior to inserting the
:ARG.num
apply to both the real and imaginary components.
If the real and imaginary components are to be inserted using different
formats, the
:MONO.real
and
:MONO.imag
member functions should be used to insert each component separately.
:RSLTS.
The &fn. returns a reference to the
:ARG.strm
object.
:SALSO.
:SAL typ='cls'.istream
:eSALSO.
:eLIBF.
:CMT.========================================================================
:LIBF fmt='mfun' prot='public'.operator =
:SNPL.
:SNPFLF .#include <complex.h>
:SNPFLF .public:
:SNPF index='operator ='.Complex &.Complex::operator =( Complex const &.num );
:SNPF index='operator ='.Complex &.Complex::operator =( double num );
:eSNPL.
:SMTICS.
The &fn. is used to set the value of the &obj. to
:ARG.num
:PERIOD.
The first assignment operator copies the value of
:ARG.num
into the &obj.:PERIOD.
:P.
The second assignment operator sets the real component of the &obj. to
:ARG.num
and the imaginary component to zero.
:INCLUDE file='cpx_asgn'.
:RSLTS.
The &fn. returns a reference to the target of the assignment.
:SALSO.
:SAL typ='mfun'.operator~b*=
:SAL typ='mfun'.operator~b+=
:SAL typ='mfun'.operator~b-=
:SAL typ='mfun'.operator~b/=
:eSALSO.
:eLIBF.
:CMT.========================================================================
:LIBF fmt='fun'.operator ==
:SNPL.
:SNPFLF .#include <complex.h>
:SNPR index='operator =='.int operator ==( Complex const &.num1, Complex const &.num2 );
:SNPR index='operator =='.int operator ==( Complex const &.num1, double num2 );
:SNPR index='operator =='.int operator ==( double num1, Complex const &.num2 );
:eSNPL.
:SMTICS.
The &fn. compares
:ARG.num1
and
:ARG.num2
for equality.
At least one of the arguments must be a &obj. for this function to be called.
:P.
Two &obj.s are equal if their corresponding real and imaginary components
are equal.
:INCLUDE file='cpx_op'.
:RSLTS.
The &fn. returns a non-zero value if
:ARG.num1
is equal to
:ARG.num2
:CONT., otherwise zero is returned.
:SALSO.
:SAL typ='fun'.operator~b!=
:eSALSO.
:eLIBF.
:CMT.========================================================================
:LIBF fmt='fun'.operator >>
:SNPL.
:SNPFLF .#include <complex.h>
:SNPR index='operator >>'.friend istream &.operator >>( istream &.strm, Complex &.num );
:eSNPL.
:SMTICS.
The &fn. is used to read a &obj. from an I/O stream.
A valid complex value is of one of the following forms:
:P.
:MONO.(real,imag)
:BREAK.
:MONO.real,imag
:BREAK.
:MONO.(real)
:P.
If the imaginary portion is omitted, zero is assumed.
:P.
While reading a &obj., whitespace is ignored before and between the various
components of the number if the
:MONO.ios::skipws
bit is set in &fmtflags.:PERIOD.
:RSLTS.
The &fn. returns a reference to
:ARG.strm
:PERIOD.
:ARG.num
contains the value read from
:ARG.strm
on success, otherwise it is unchanged.
:SALSO.
:SAL typ='cls'.istream
:eSALSO.
:eLIBF.
:CMT.========================================================================
:LIBF fmt='fun'.polar
:SNPL.
:SNPFLF .#include <complex.h>
:SNPR index='polar'.Complex polar( double mag, double angle = 0.0 );
:eSNPL.
:SMTICS.
The &fn. converts
:ARG.mag
and
:ARG.angle
(polar coordinates) into a complex number.
The
:ARG.angle
is optional and defaults to zero if it is unspecified.
:RSLTS.
The &fn. returns a &obj. that is
:ARG.mag
and
:ARG.angle
interpreted as polar coordinates.
:SALSO.
:SAL typ='fun'.abs
:SAL typ='fun'.arg
:SAL typ='fun'.norm
:eSALSO.
:eLIBF.
:CMT.========================================================================
:LIBF fmt='fun'.pow
:SNPL.
:SNPFLF .#include <complex.h>
:SNPR index='pow'.Complex pow( Complex const &.num, Complex const &.exp );
:SNPR index='pow'.Complex pow( Complex const &.num, double exp );
:SNPR index='pow'.Complex pow( double num, Complex const &.exp );
:SNPR index='pow'.Complex pow( Complex const &.num, int exp );
:eSNPL.
:SMTICS.
The &fn. computes
:ARG.num
raised to the power
:ARG.exp
:PERIOD.
The various forms are provided to minimize the amount of floating-point
calculation performed.
:RSLTS.
The &fn. returns a &obj. that is
:ARG.num
raised to the power a &obj. that is
:ARG.exp
:PERIOD.
:SALSO.
:SAL typ='fun'.exp
:SAL typ='fun'.log
:SAL typ='fun'.log10
:SAL typ='fun'.sqrt
:eSALSO.
:eLIBF.
:CMT.========================================================================
:LIBF fmt='mfun' prot='public'.real
:SNPL.
:SNPFLF .#include <complex.h>
:SNPFLF .public:
:SNPF index='real'.double Complex::real();
:eSNPL.
:SMTICS.
The &fn. extracts the real component of the &obj.:PERIOD.
:RSLTS.
The &fn. returns the real component of the &obj.:PERIOD.
:SALSO.
:SAL typ='fun'.imag
:SAL typ='fun'.real
:SAL typ='mfun'.imag
:eSALSO.
:eLIBF.
:CMT.========================================================================
:LIBF fmt='fun'.real
:SNPL.
:SNPFLF .#include <complex.h>
:SNPR index='real'.double real( Complex const &.num );
:eSNPL.
:SMTICS.
The &fn. extracts the real component of
:ARG.num
:PERIOD.
:RSLTS.
The &fn. returns the real component of
:ARG.num
:PERIOD.
:SALSO.
:SAL typ='fun'.imag
:SAL typ='mfun'.imag
:SAL typ='mfun'.real
:eSALSO.
:eLIBF.
:CMT.========================================================================
:LIBF fmt='fun'.sin
:SNPL.
:SNPFLF .#include <complex.h>
:SNPR index='sin'.Complex sin( Complex const &.num );
:eSNPL.
:SMTICS.
The &fn. computes the sine of
:ARG.num
:PERIOD.
:RSLTS.
The &fn. returns the sine of
:ARG.num
:PERIOD.
:SALSO.
:SAL typ='fun'.asin
:SAL typ='fun'.cos
:SAL typ='fun'.tan
:eSALSO.
:eLIBF.
:CMT.========================================================================
:LIBF fmt='fun'.sinh
:SNPL.
:SNPFLF .#include <complex.h>
:SNPR index='sinh'.Complex sinh( Complex const &.num );
:eSNPL.
:SMTICS.
The &fn. computes the hyperbolic sine of
:ARG.num
:PERIOD.
:RSLTS.
The &fn. returns the hyperbolic sine of
:ARG.num
:PERIOD.
:SALSO.
:SAL typ='fun'.asinh
:SAL typ='fun'.cosh
:SAL typ='fun'.tanh
:eSALSO.
:eLIBF.
:CMT.========================================================================
:LIBF fmt='fun'.sqrt
:SNPL.
:SNPFLF .#include <complex.h>
:SNPR index='sqrt'.Complex sqrt( Complex const &.num );
:eSNPL.
:SMTICS.
The &fn. computes the square root of
:ARG.num
:PERIOD.
:RSLTS.
The &fn. returns the square root of
:ARG.num
:PERIOD.
:SALSO.
:SAL typ='fun'.exp
:SAL typ='fun'.log
:SAL typ='fun'.log10
:SAL typ='fun'.pow
:eSALSO.
:eLIBF.
:CMT.========================================================================
:LIBF fmt='fun'.tan
:SNPL.
:SNPFLF .#include <complex.h>
:SNPR index='tan'.Complex tan( Complex const &.num );
:eSNPL.
:SMTICS.
The &fn. computes the tangent of
:ARG.num
:PERIOD.
:RSLTS.
The &fn. returns the tangent of
:ARG.num
:PERIOD.
:SALSO.
:SAL typ='fun'.atan
:SAL typ='fun'.cos
:SAL typ='fun'.sin
:eSALSO.
:eLIBF.
:CMT.========================================================================
:LIBF fmt='fun'.tanh
:SNPL.
:SNPFLF .#include <complex.h>
:SNPR index='tanh'.Complex tanh( Complex const &.num );
:eSNPL.
:SMTICS.
The &fn. computes the hyperbolic tangent of
:ARG.num
:PERIOD.
:RSLTS.
The &fn. returns the hyperbolic tangent of
:ARG.num
:PERIOD.
:SALSO.
:SAL typ='fun'.atanh
:SAL typ='fun'.cosh
:SAL typ='fun'.sinh
:eSALSO.
:eLIBF.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -