home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Vectronix 2
/
VECTRONIX2.iso
/
FILES_07
/
LATTIC_3.ZIP
/
SRC
/
CXFPE.C
< prev
next >
Wrap
C/C++ Source or Header
|
1990-03-07
|
815b
|
44 lines
/***
*
* Copyright ⌐ 1989 Lattice, Inc.
*
* name _CXFPE -- low-level floating point error handler
*
* synopsis _CXFPE(sig);
* int sig; signal number
*
* description This function is the default function to be called
* when the SIGFPE signal has been raised. It sets
* errno appropriately.
*
***/
#include <signal.h>
#include <math.h>
#include <errno.h>
extern void _CXFPE(int);
extern int _FPERR;
void _CXFPE(sig)
int sig;
{
switch(_FPERR) {
case FPEUND:
case FPEOVF:
case FPEZDV:
errno = ERANGE;
break;
case FPENAN:
case FPECOM:
errno = EDOM;
break;
}
return;
}