Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ complex_error(3C++) — UnixWare 2.01

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

complex(3C++)

matherr(3M)

cartpol(3C++)

cplxops(3C++)

cplxexp(3C++)

cplxtrig(3C++)






       complex_error(3C++)                              complex_error(3C++)


       NAME
             complex_error - error-handling function for the C++ Complex
             Math Library

       SYNOPSIS
             #include <complex.h>
             class c_exception
             {
                   int   type;
                   char  *name;
                   complex     arg1;
                   complex     arg2;
                   complex     retval;

             public:

                   c_exception( char *n, const complex& a1, const complex& a2 = complex_zero );

                   friend int  complex_error( c_exception& );

                   friend complex    exp( complex );
                   friend complex    sinh( complex );
                   friend complex    cosh( complex );
                   friend complex    log( complex );
             };

       DESCRIPTION
             In the following description of the complex error handling
             routine,
              - i is of type int and
              - x is of type c_exception.

             i = complex_error(x)     Invoked by functions in the C++
                                      Complex Mathematics Library when
                                      errors are detected.

             Users may define their own procedures for handling errors, by
             defining a function named complex_error in their programs.
             complex_error must be of the form described above.

             The element type is an integer describing the type of error
             that has occurred, from the following list of constants
             (defined in the header file):
             SING      argument singularity
             OVERFLOW  overflow range error
             UNDERFLOW underflow range error


                           Copyright 1994 Novell, Inc.               Page 1













      complex_error(3C++)                              complex_error(3C++)


            The element name points to a string containing the name of the
            function that incurred the error.  The variables arg1 and arg2
            are the arguments with which the function was invoked.  retval
            is set to the default value that will be returned by the
            function unless the user's complex_error sets it to a
            different value.

            If the user's complex_error function returns non-zero, no
            error message will be printed, and errno will not be set.

            If complex_error is not supplied by the user, the default
            error-handling procedures, described with the complex math
            functions involved, will be invoked upon error.  These
            procedures are also summarized in the table below.  In every
            case, errno is set to EDOM or ERANGE and the program
            continues.

            Note that complex math functions call functions included in
            the math library which has its own error handling routine,
            matherr(3M).  Users may also override this routine by
            supplying their own version.

          ____________________________________________________________
         |             DEFAULT ERROR HANDLING PROCEDURES             |
         |______________________|____________________________________|
         |______________________|____________________________________|
         |                      |           Types of Errors          |
         |______________________|____________|___________|___________|
         |______________________|____________|___________|___________|
         |         type         |     SING   |  OVERFLOW |  UNDERFLOW|
         |______________________|____________|___________|___________|
         |______________________|____________|___________|___________|
         |         errno        |     EDOM   |   ERANGE  |   ERANGE  |
         |______________________|____________|___________|___________|
         |______________________|____________|___________|___________|
         | EXP:                 |            |           |           |
         |______________________|____________|___________|___________|
         |  real too large/small|      -     |  (_H, _H) |   (0, 0)  |
         |______________________|____________|___________|___________|
         |  imag too large      |      -     |   (0, 0)  |      -    |
         |______________________|____________|___________|___________|
         |______________________|____________|___________|___________|
         | LOG:                 |            |           |           |
         |______________________|____________|___________|___________|
         |______________________|____________|___________|___________|



                          Copyright 1994 Novell, Inc.               Page 2













       complex_error(3C++)                              complex_error(3C++)


          |  arg = (0, 0)        |  M, (H, 0) |      -    |      -    |
          |______________________|____________|___________|___________|
          |______________________|____________|___________|___________|
          | SINH:                |            |           |           |
          |______________________|____________|___________|___________|
          |  real too large      |      -     |  (_H, _H) |      -    |
          |______________________|____________|___________|___________|
          |  imag too large      |      -     |   (0, 0)  |      -    |
          |______________________|____________|___________|___________|
          |______________________|____________|___________|___________|
          | COSH:                |            |           |           |
          |______________________|____________|___________|___________|
          |  real too large      |      -     |  (_H, _H) |      -    |
          |______________________|____________|___________|___________|
          |  imag too large      |      -     |   (0, 0)  |      -    |
          |______________________|____________|___________|___________|

             ______________________________________________
            |                ABBREVIATIONS                |
            |     M       Message is printed (EDOM error).|
            |   (H, 0)    (HUGE, 0) is returned.          |
            |  (_H, _H)   (_HUGE, _HUGE) is returned.     |
            |   (0, 0)    (0, 0) is returned.             |
            |_____________________________________________|

       REFERENCES
             complex(3C++), matherr(3M), cartpol(3C++), cplxops(3C++),
             cplxexp(3C++), cplxtrig(3C++).




















                           Copyright 1994 Novell, Inc.               Page 3








Typewritten Software • bear@typewritten.org • Edmonds, WA 98026