ieeefp.h revision 1.8
1/* $NetBSD: ieeefp.h,v 1.8 2012/03/20 23:57:57 christos Exp $ */ 2 3/* 4 * Written by J.T. Conklin, Apr 6, 1995 5 * Public domain. 6 */ 7 8#ifndef _SPARC_IEEEFP_H_ 9#define _SPARC_IEEEFP_H_ 10 11#include <sys/featuretest.h> 12 13#if defined(_NETBSD_SOURCE) || defined(_ISOC99_SOURCE) 14 15#define FE_INEXACT 0x01 /* imprecise (loss of precision) */ 16#define FE_DIVBYZERO 0x02 /* divide-by-zero exception */ 17#define FE_UNDERFLOW 0x04 /* overflow exception */ 18#define FE_OVERFLOW 0x08 /* underflow exception */ 19#define FE_INVALID 0x10 /* invalid operation exception */ 20 21#define FE_ALL_EXCEPT 0x1f 22 23#define FE_TONEAREST 0 /* round to nearest representable number */ 24#define FE_TOWARDZERO 1 /* round to zero (truncate) */ 25#define FE_UPWARD 2 /* round toward positive infinity */ 26#define FE_DOWNWARD 3 /* round toward negative infinity */ 27 28#if !defined(_ISOC99_SOURCE) 29 30typedef unsigned int fp_except; 31#define FP_X_IMP FE_INEXACT /* imprecise (loss of precision) */ 32#define FP_X_DZ FE_DIVBYZERO /* divide-by-zero exception */ 33#define FP_X_UFL FE_UNDERFLOW /* underflow exception */ 34#define FP_X_OFL FE_OVERFLOW /* overflow exception */ 35#define FP_X_INV FE_INVALID /* invalid operation exception */ 36 37typedef enum { 38 FP_RN=FE_TONEAREST, /* round to nearest representable number */ 39 FP_RZ=FE_TOWARDZERO, /* round to zero (truncate) */ 40 FP_RP=FE_UPWARD, /* round toward positive infinity */ 41 FP_RM=FE_DOWNWARD /* round toward negative infinity */ 42} fp_rnd; 43 44#endif /* !_ISOC99_SOURCE */ 45 46#endif /* _NETBSD_SOURCE || _ISOC99_SOURCE */ 47 48#endif /* _SPARC_IEEEFP_H_ */ 49