The following examples show how to create handler routines to detect floating-point exceptions.
Example: Detect exception and abort:
SIGFPE is generated whenever that floating-point exception occurs. When the SIGFPE is detected, control passes to the myhandler function, which immediately aborts. Compile with -g and use dbx to find the location of the exception.