SIGFPE Macro

Signals floating-point errors such as for division by zero or result out of range.

Include

<signal.h>

Prototype

#define SIGFPE

Remarks

SIGFPE is used as an argument for raise and/or signal. When used, the default behavior is to print an arithmetic error message and terminate the calling program. This may be overridden by a user function that defines the signal handler actions. See signal for an example of a user-defined function.

Example

#include <signal.h> /* for raise, SIGFPE */
#include <stdio.h> /* for printf */

int main(void)
{
  raise(SIGFPE);
  printf("Program never reaches here");
}

Example Output

FPE

where FPE stands for “floating-point error.”