home *** CD-ROM | disk | FTP | other *** search
-
- #include <stdio.h>
- #include <string.h>
-
-
- struct exception {
- int type; /* type of error, see below */
- char *name; /* name of math function */
- double arg1; /* value of first argument to function */
- double arg2; /* second argument (if indicated) */
- double retval; /* default return value */
- };
-
- int matherr(struct exception *erre) {
-
- char errorstr[][10]={"DOMAIN","SING","OVERFLOW","UNDERFLOW","TLOSS","PLOSS"};
-
- printf("MATH ERROR: Function \n",erre->name);
- printf("Type %s \n",errorstr[erre->type-1]);
- printf("Press a key to continue\n");
- getche();
-
- return(0);
-
- }
-