cplxops(3C)
complex_operators - Operators for the C++ complex math library
As shipped in IRIX 6.5.30. Last changed in IRIX 6.5.19.
NAME complex_operators - Operators for the C++ complex math library SYNOPSIS #include <complex.h> class complex { public: friend complex operator+(complex, complex); friend complex operator-(complex); friend complex operator-(complex, complex); friend complex operator*(complex, complex); friend complex operator/(complex, complex); friend int operator==(complex, complex); friend int operator!=(complex, complex); void operator+=(complex); void operator-=(complex); void operator*=(complex); void operator/=(complex); }; DESCRIPTION NOTE: This man page applies only to the -o32 ABI. The MIPSpro -n32 and -64 ABIs support the template-based complex class which is included in the C++ standard library and is automatically loaded by the MIPSpro C++ compiler. The -lm option must still be used to link the math library. The basic arithmetic operators, comparison operators, and assignment operators are overloaded for complex numbers. The operators have their conventional precedences. In the following descriptions for complex operators, x, y, and z are of type complex. Arithmetic operators: z = x + y Returns a complex which is the arithmetic sum of complex numbers x and y. z = -x Returns a complex which is the arithmetic negation of complex number x. z = x - y Returns a complex which is the arithmetic difference of complex numbers x and y. z = x * y Returns a complex which is the arithmetic product of complex numbers x and y. z = x / y Returns a complex which is the arithmetic quotient of complex numbers x and y. Comparison operators: x == y Returns non-zero if complex number x is equal to complex number y; returns 0 otherwise. x != y Returns non-zero if complex number x is not equal to complex number y; returns 0 otherwise. Assignment operators: x += y Complex number x is assigned the value of the arithmetic sum of itself and complex number y. x -= y Complex number x is assigned the value of the arithmetic difference of itself and complex number y. x *= y Complex number x is assigned the value of the arithmetic product of itself and complex number y. x /= y Complex number x is assigned the value of the arithmetic quotient of itself and complex number y. WARNINGS The assignment operators do not produce a value that can be used in an expression. That is, the following construction is syntactically invalid: complex x, y, z; . x = ( y += z ); Whereas, the following is valid: x = ( y + z ); x = ( y == z ); SEE ALSO complex(3C), cartpol(3C), cplxerr(3C), cplxexp(3C), cplxtrig(3C)