exception

Contains error information.

Service:Math

Structure

  #include <math.h>
  
  __FP_EXCEPTION 
  {
     int      type; 
     char     *name; 
     double   arg1; 
     double   arg2; 
     double   retval; 
  };
  
  #ifdef __cplusplus
  # define __FP_EXCEPTION   struct __fp_exception
  #else
  # define __FP_EXCEPTION    struct exception
  #endif
  

Fields

type

Specifies the error type.

The type field contains one of the following values:

Flag

Value

Meaning

DOMAIN

1

A domain error has occurred, such as sqrt (-1e0).

SING

2

A singularity would result, such as pow (0e0,-2).

OVERFLOW

3

An overflow would result, such as pow (10e0,100).

UNDERFLOW

4

An underflow would result, such as pow (10e0,-100).

TLOSS

5

Total loss of significance would result, such as exp(1000).

PLOSS

6

Partial loss of significance would result, such as sin(10e70).

name

Points to a string containing the name of the function that detected the error.

arg1

Specifies the first argument to the function.

arg2

Specifies the second argument to the function.

retval

Specifies the default return value. This is the only field that can be changed by a developer-supplied version of matherr.