3. Using the C++ Compiler Options
6. Creating and Using Templates
9. Improving Program Performance
10. Building Multithreaded Programs
12. Using The C++ Standard Library
13. Using the Classic iostream Library
14. Using the Complex Arithmetic Library
14.1.1 Using the Complex Library
The complex library has these definitions for error handling:
extern int errno; class c_exception {...}; int complex_error(c_exception&);
The external variable errno is the global error state from the C library. errno can take on the values listed in the standard header errno.h (see the man page perror(3)). No function sets errno to zero, but many functions set it to other values.
To determine whether a particular operation fails:
Set errno to zero before the operation.
Test the operation.
The function complex_error takes a reference to type c_exception and is called by the following complex arithmetic library functions:
exp
log
log10
sinh
cosh
The default version of complex_error returns zero. This return of zero means that the default error handling takes place. You can provide your own replacement function complex_error that performs other error handling. Error handling is described in the man page cplxerr(3CC4).
Default error handling is described in the man pages cplxtrig(3CC4) and cplxexp(3CC4) It is also summarized in the following table.
|