home *** CD-ROM | disk | FTP | other *** search
/ Stars of Shareware: Raytrace & Morphing / SOS-RAYTRACE.ISO / programm / rad386 / radiosit / src / matherr.c < prev    next >
Encoding:
C/C++ Source or Header  |  1992-01-30  |  602 b   |  27 lines

  1.  
  2. #include <stdio.h>
  3. #include <string.h>
  4.  
  5.  
  6. struct    exception {
  7.     int    type;        /* type of error, see below */
  8.     char    *name;        /* name of math function */
  9.     double    arg1;        /* value of first argument to function */
  10.     double    arg2;        /* second argument (if indicated) */
  11.     double    retval;     /* default return value */
  12. };
  13.  
  14. int matherr(struct exception *erre) {
  15.  
  16. char errorstr[][10]={"DOMAIN","SING","OVERFLOW","UNDERFLOW","TLOSS","PLOSS"};
  17.  
  18. printf("MATH ERROR: Function \n",erre->name);
  19. printf("Type %s \n",errorstr[erre->type-1]);
  20. printf("Press a key to continue\n");
  21. getche();
  22.  
  23. return(0);
  24.  
  25. }
  26.  
  27.