/* $NetBSD: flt_rounds.c,v 1.4 1997/10/27 05:28:46 phil Exp $ */ /* * Written by J.T. Conklin, Apr 28, 1995 * Public domain. */ #include #if defined(LIBC_SCCS) && !defined(lint) __RCSID("$NetBSD: flt_rounds.c,v 1.4 1997/10/27 05:28:46 phil Exp $"); #endif /* LIBC_SCCS and not lint */ #include static const int map[] = { 1, /* round to nearest */ 0, /* round to zero */ 2, /* round to positive infinity */ 3 /* round to negative infinity */ }; int __flt_rounds __P((void)); int __flt_rounds(void) { int x; sfsr(x); return map[(x >> 7) & 0x03]; }