home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The C Users' Group Library 1994 August
/
wc-cdrom-cusersgrouplibrary-1994-08.iso
/
listings
/
v_08_04
/
8n04031a
< prev
next >
Wrap
Text File
|
1990-03-20
|
576b
|
29 lines
*****Listing 3*****
#include <math.h> /* get struct */
int matherr(struct exception *pe)
{
int retval = 1; /* assume we'll recover */
printf("Function %s failed with error type ", pe->name);
if (pe->type == DOMAIN)
printf("DOMAIN\n");
else if (pe->type == SING)
printf("SING\n");
else if (pe->type == OVERFLOW)
printf("OVERFLOW\n");
else if (pe->type == UNDERFLOW)
printf("UNDERFLOW\n");
else if (pe->type == TLOSS)
printf("TLOSS\n");
else {
printf("UNKNOWN\n");
retval = 0; /* can't handle here */
}
return retval;
}