Home | History | Annotate | Line # | Download | only in include
ieeefp.h revision 1.9
      1  1.9    martin /*	$NetBSD: ieeefp.h,v 1.9 2015/01/03 18:12:12 martin Exp $	*/
      2  1.3     perry 
      3  1.2        pk /*
      4  1.1       jtc  * Written by J.T. Conklin, Apr 6, 1995
      5  1.1       jtc  * Public domain.
      6  1.1       jtc  */
      7  1.1       jtc 
      8  1.1       jtc #ifndef _SPARC_IEEEFP_H_
      9  1.1       jtc #define _SPARC_IEEEFP_H_
     10  1.1       jtc 
     11  1.5      matt #include <sys/featuretest.h>
     12  1.5      matt 
     13  1.5      matt #if defined(_NETBSD_SOURCE) || defined(_ISOC99_SOURCE)
     14  1.5      matt 
     15  1.5      matt #define	FE_TONEAREST	0	/* round to nearest representable number */
     16  1.5      matt #define	FE_TOWARDZERO	1	/* round to zero (truncate) */
     17  1.5      matt #define	FE_UPWARD	2	/* round toward positive infinity */
     18  1.5      matt #define	FE_DOWNWARD	3	/* round toward negative infinity */
     19  1.5      matt 
     20  1.5      matt #if !defined(_ISOC99_SOURCE)
     21  1.5      matt 
     22  1.8  christos typedef unsigned int fp_except;
     23  1.9    martin #define FP_X_IMP	0x01		/* imprecise (loss of precision) */
     24  1.9    martin #define FP_X_DZ		0x02		/* divide-by-zero exception */
     25  1.9    martin #define FP_X_UFL	0x04		/* underflow exception */
     26  1.9    martin #define FP_X_OFL	0x08		/* overflow exception */
     27  1.9    martin #define FP_X_INV	0x10		/* invalid operation exception */
     28  1.1       jtc 
     29  1.1       jtc typedef enum {
     30  1.9    martin     FP_RN=0,			/* round to nearest representable number */
     31  1.9    martin     FP_RZ=1,			/* round to zero (truncate) */
     32  1.9    martin     FP_RP=2,			/* round toward positive infinity */
     33  1.9    martin     FP_RM=3			/* round toward negative infinity */
     34  1.1       jtc } fp_rnd;
     35  1.1       jtc 
     36  1.5      matt #endif /* !_ISOC99_SOURCE */
     37  1.5      matt 
     38  1.5      matt #endif /* _NETBSD_SOURCE || _ISOC99_SOURCE */
     39  1.5      matt 
     40  1.1       jtc #endif /* _SPARC_IEEEFP_H_ */
     41