home *** CD-ROM | disk | FTP | other *** search
/ Vectronix 2 / VECTRONIX2.iso / FILES_01 / LATTIC_3.LZH / SRC / CXFERR.C < prev    next >
C/C++ Source or Header  |  1990-03-07  |  752b  |  34 lines

  1. /***
  2. *
  3. *          Copyright ⌐ 1989  Lattice, Inc.
  4. *
  5. * name             _CXFERR -- low-level floating point error trap 
  6. *
  7. * synopsis         _CXFERR(code);
  8. *                  int code;       error code (see math.h)
  9. *
  10. * description      This function is called when an error is detected by
  11. *                  one of the low-level floating point routines, such as
  12. *                  the arithmetic operations.  Higher-level routines such
  13. *                  as the transcendental functions, use the more sophisti-
  14. *                  cated "matherr" trap.
  15. *
  16. ***/
  17.  
  18. #include <signal.h>
  19.  
  20. void __stdargs _CXFERR(int);
  21.  
  22.  
  23. extern int _FPERR;
  24.  
  25.  
  26.  
  27. void __stdargs _CXFERR(code)
  28.     int code;
  29. {
  30.     _FPERR = code;
  31.  
  32.     raise(SIGFPE);
  33. }
  34.