diff options
| author | jtc <jtc@NetBSD.org> | 1995-04-07 00:59:09 +0000 |
|---|---|---|
| committer | jtc <jtc@NetBSD.org> | 1995-04-07 00:59:09 +0000 |
| commit | a9ae458fc39bbf7781f5571cd2d2d12b6721cc37 (patch) | |
| tree | a8f8fa0329f97df69d11f4bf4dda0e38a72d1a12 /include | |
| parent | 7a5da7fda214da3dafe0e3d0de928baa98e8f081 (diff) | |
New header file <ieeefp.h>, which provides a API for getting and setting
IEEE rounding mode, exception enable flags, and exception sticky flags.
Diffstat (limited to 'include')
| -rw-r--r-- | include/Makefile | 10 | ||||
| -rw-r--r-- | include/ieeefp.h | 46 |
2 files changed, 51 insertions, 5 deletions
diff --git a/include/Makefile b/include/Makefile index 400754e6b95..ee8e0008fb7 100644 --- a/include/Makefile +++ b/include/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.52 1995/02/17 09:08:08 jtc Exp $ +# $NetBSD: Makefile,v 1.53 1995/04/07 00:59:09 jtc Exp $ # @(#)Makefile 5.45.1.1 (Berkeley) 5/6/91 @@ -10,10 +10,10 @@ # Missing: mp.h FILES= a.out.h ar.h assert.h bitstring.h bm.h ctype.h db.h dirent.h disktab.h \ - err.h fnmatch.h fstab.h fts.h glob.h grp.h iso646.h kvm.h langinfo.h \ - limits.h locale.h math.h memory.h mpool.h ndbm.h netdb.h netgroup.h \ - nlist.h nl_types.h paths.h pwd.h ranlib.h regex.h regexp.h resolv.h \ - search.h setjmp.h sgtty.h signal.h stab.h stddef.h \ + err.h fnmatch.h fstab.h fts.h glob.h grp.h ieeefp.h iso646.h kvm.h \ + langinfo.h limits.h locale.h math.h memory.h mpool.h ndbm.h netdb.h \ + netgroup.h nlist.h nl_types.h paths.h pwd.h ranlib.h regex.h regexp.h \ + resolv.h search.h setjmp.h sgtty.h signal.h stab.h stddef.h \ stdio.h stdlib.h string.h strings.h struct.h sysexits.h time.h \ ttyent.h tzfile.h unistd.h utime.h utmp.h vis.h malloc.h \ link.h diff --git a/include/ieeefp.h b/include/ieeefp.h new file mode 100644 index 00000000000..a514fa05978 --- /dev/null +++ b/include/ieeefp.h @@ -0,0 +1,46 @@ +/* + * Written by J.T. Conklin, Apr 6, 1995 + * Public domain. + */ + +#ifndef _IEEEFP_H_ +#define _IEEEFP_H_ + +#include <sys/cdefs.h> + +typedef int fp_except; +#ifdef __i386__ +#define FP_X_INV 0x01 /* invalid operation exception */ +#define FP_X_DNML 0x02 /* denormalization exception */ +#define FP_X_DZ 0x04 /* divide-by-zero exception */ +#define FP_X_OFL 0x08 /* overflow exception */ +#define FP_X_UFL 0x10 /* underflow exception */ +#define FP_X_IMP 0x20 /* imprecise (loss of precision) */ +#endif + +#if defined(__i386__) +typedef enum { + FP_RN=0, /* round to nearest representable number */ + FP_RP=1, /* round to positive infinity */ + FP_RM=2, /* round to negative infinity */ + FP_RZ=3 /* round to zero (truncate) */ +} fp_rnd ; + +#elif defined(__m68k__) +typedef enum { + FP_RN=0, /* round to nearest representable number */ + FP_RZ=1, /* round to zero (truncate) */ + FP_RM=2, /* round to negative infinity */ + FP_RP=3 /* round to positive infinity */ +} fp_rnd ; + +#endif + +extern fp_rnd fpgetround __P((void)); +extern fp_rnd fpsetround __P((fp_rnd)); +extern fp_except fpgetmask __P((void)); +extern fp_except fpsetmask __P((fp_except)); +extern fp_except fpgetsticky __P((void)); +extern fp_except fpsetsticky __P((fp_except)); + +#endif /* _IEEEFP_H_ */ |
