home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power-Programmierung
/
CD1.mdf
/
magazine
/
spoc88
/
cflt20
/
ieeetype.c
< prev
next >
Wrap
Text File
|
1988-04-14
|
352b
|
16 lines
enum ieee {
ieee_normal,
ieee_pINF,
ieee_mINF,
ieee_NAN,
};
enum ieee ieee_type(long double x)
{
unsigned int *a = (unsigned int *) &x;
if ((a[4] & 0x7FFF) != 0x7FFF) return ieee_normal;
if (a[0] | a[1] | a[2] | (a[3] & 0x7FFF)) return ieee_NAN;
return a[4] & 0x8000 ? ieee_mINF : ieee_pINF;
}