Home | History | Annotate | Line # | Download | only in include
ieeefp.h revision 1.3
      1  1.3   matt /*	$NetBSD: ieeefp.h,v 1.3 2013/04/23 05:42:23 matt Exp $	*/
      2  1.1  bjh21 
      3  1.1  bjh21 /*
      4  1.1  bjh21  * Based on ieeefp.h written by J.T. Conklin, Apr 28, 1995
      5  1.1  bjh21  * Public domain.
      6  1.1  bjh21  */
      7  1.1  bjh21 
      8  1.3   matt #ifndef _ARM_IEEEFP_H_
      9  1.3   matt #define _ARM_IEEEFP_H_
     10  1.1  bjh21 
     11  1.2   matt #include <sys/featuretest.h>
     12  1.1  bjh21 
     13  1.2   matt #if defined(_NETBSD_SOURCE) || defined(_ISOC99_SOURCE)
     14  1.2   matt 
     15  1.3   matt #include <arm/fenv.h>
     16  1.2   matt 
     17  1.2   matt #if !defined(_ISOC99_SOURCE)
     18  1.1  bjh21 
     19  1.1  bjh21 /* Exception type (used by fpsetmask() et al.) */
     20  1.1  bjh21 
     21  1.1  bjh21 typedef int fp_except;
     22  1.1  bjh21 
     23  1.1  bjh21 /* Bit defines for fp_except */
     24  1.1  bjh21 
     25  1.2   matt #define	FP_X_INV	FE_INVALID	/* invalid operation exception */
     26  1.2   matt #define	FP_X_DZ		FE_DIVBYZERO	/* divide-by-zero exception */
     27  1.2   matt #define	FP_X_OFL	FE_OVERFLOW	/* overflow exception */
     28  1.2   matt #define	FP_X_UFL	FE_UNDERFLOW	/* underflow exception */
     29  1.2   matt #define	FP_X_IMP	FE_INEXACT	/* imprecise (prec. loss; "inexact") */
     30  1.1  bjh21 
     31  1.1  bjh21 /* Rounding modes */
     32  1.1  bjh21 
     33  1.1  bjh21 typedef enum {
     34  1.2   matt     FP_RN=FE_TONEAREST,		/* round to nearest representable number */
     35  1.2   matt     FP_RP=FE_UPWARD,		/* round toward positive infinity */
     36  1.2   matt     FP_RM=FE_DOWNWARD,		/* round toward negative infinity */
     37  1.2   matt     FP_RZ=FE_TOWARDZERO		/* round to zero (truncate) */
     38  1.1  bjh21 } fp_rnd;
     39  1.1  bjh21 
     40  1.2   matt #endif /* !_ISOC99_SOURCE */
     41  1.2   matt 
     42  1.2   matt #endif /* _NETBSD_SOURCE || _ISOC99_SOURCE */
     43  1.2   matt 
     44  1.3   matt #endif /* _ARM_IEEEFP_H_ */
     45