*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->IRIX man pages -> c++/cplxops (3)              
Title
Content
Arch
Section
 

Contents


CPLXOPS(3C++)							 CPLXOPS(3C++)


NAME    [Toc]    [Back]

     complex_operators -  operators for	the C++	complex	math library

SYNOPSIS    [Toc]    [Back]

     #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    [Toc]    [Back]

     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 <b>= x <b>+ y	    Returns a complex which is the arithmetic sum of complex
		    numbers x and y.

     z <b>= -x	    Returns a complex which is the arithmetic negation of
		    complex number x.

     z <b>= x <b>- y	    Returns a complex which is the arithmetic difference of
		    complex numbers x and y.

     z <b>= x <b>* y	    Returns a complex which is the arithmetic product of
		    complex numbers x and y.

     z <b>= x <b>/ y	    Returns a complex which is the arithmetic quotient of
		    complex numbers x and y.

     Comparison	operators:






									Page 1






CPLXOPS(3C++)							 CPLXOPS(3C++)



     x <b>== y	    Returns non-zero if	complex	number x is equal to complex
		    number y; returns 0	otherwise.

     x <b>!= y	    Returns non-zero if	complex	number x is not	equal to
		    complex number y; returns 0	otherwise.

     Assignment	operators:

     x <b>+= y	    Complex number x is	assigned the value of the arithmetic
		    sum	of itself and complex number y.

     x <b>-= y	    Complex number x is	assigned the value of the arithmetic
		    difference of itself and complex number y.

     x <b>*= y	    Complex number x is	assigned the value of the arithmetic
		    product of itself and complex number y.

     x <b>/= y	    Complex number x is	assigned the value of the arithmetic
		    quotient of	itself and complex number y.

WARNING    [Toc]    [Back]

     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,

	  x = (	y + z );

	  x = (	y == z );
     are valid.

SEE ALSO    [Toc]    [Back]

      
      
     complex(3C++), cartpol(3C++), cplxerr(3C++), cplxexp(3C++), and
     cplxtrig(3C++).


									PPPPaaaaggggeeee 2222
[ Back ]
 Similar pages
Name OS Title
cartpol IRIX functions for the C++ Complex Math Library
cplxerr IRIX error-handling function for the C++ Complex Math Library
intro_libm IRIX Introduction to math library routines
crtmathfnc IRIX Define a new math function for expressions
math HP-UX math functions, constants, and types
Math::BigFloat IRIX Arbitrary length float math package
Math::BigInt IRIX Arbitrary size integer math package
erfcf NetBSD error function operators
erfc NetBSD error function operators
erff NetBSD error function operators
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service