freebsd-skq/lib
David Schultz c4da2324a3 Fix a bug where rintf() rounded the wrong way in round-to-nearest mode
on all inputs of the form x.75, where x is an even integer and
log2(x) = 21.  A similar problem occurred when rounding upward.
The bug involves the following snippet copied from rint():

	i>>=1;
	if((i0&i)!=0) i0 = (i0&(~i))|((0x100000)>>j0);

The constant 0x100000 should be 0x200000.  Apparently this case was
never tested.

It turns out that the bit manipulation is completely superfluous
anyway, so remove it.  (It tries to simulate 90% of the rounding
process that the FPU does anyway.)  Also, the special case of +-0 is
handled twice (in different ways), so remove the second instance.

Throw in some related simplifications from bde:

- Work around a bug where gcc fails to clip to float precision by
  declaring two float variables as volatile.  Previously, we
  tricked gcc into generating correct code by declaring some
  float constants as doubles.

- Remove additional superfluous bit manipulation.

- Minor reorganization.

- Include <sys/types.h> explicitly.

Note that some of the equivalent lines in rint() also appear to be
unnecessary, but I'll defer to the numerical analysts who wrote it,
since I can't test all 2^64 cases.

Discussed with:	bde
2004-06-09 21:24:52 +00:00
..
compat
csu C runtime support for FreeBSD/arm. 2004-05-14 12:19:04 +00:00
libalias
libarchive Correct some spelling errors. 2004-06-08 00:23:27 +00:00
libatm Use WARNS?=3 for these in the arm case for now, due to toolchain issues. 2004-05-14 13:31:21 +00:00
libbind
libbluetooth
libbsnmp
libbz2
libc Remove a couple of casts added for an ancient Sun compiler. 2004-06-08 12:20:40 +00:00
libc_r
libcalendar
libcam
libcom_err
libcompat
libcrypt
libdevinfo
libdevstat
libdisk Handle read_block() failures by ignoring the disk rather than 2004-06-04 11:49:11 +00:00
libedit
libexpat
libfetch
libform
libftpio
libgeom
libio
libipsec
libipx Don't declare spectHex() inside a function, use a real prototype. 2004-05-24 16:48:53 +00:00
libisc
libkiconv
libkse Avoid clobbering the red zone when running on the new context's stack in 2004-06-07 21:25:16 +00:00
libkvm Avoid assignments to cast expressions. 2004-06-08 13:08:19 +00:00
libmd
libmenu
libmilter Honor NOINET6 and disable IPv6 support in libmilter and sendmail if it 2004-06-01 01:29:42 +00:00
libmp
libncp Distinguish cases when ncp module not loaded and when module have old 2004-06-02 03:41:10 +00:00
libncurses
libnetgraph
libngatm
libopie
libpam
libpanel
libpcap
libpthread Avoid clobbering the red zone when running on the new context's stack in 2004-06-07 21:25:16 +00:00
libpthread_dbg
libradius Put crypto-aware version of the library into the right distribution. 2004-05-12 06:31:36 +00:00
librpcsvc
libsbuf
libsdp
libsm Honor NOINET6 and disable IPv6 support in libmilter and sendmail if it 2004-06-01 01:29:42 +00:00
libsmb
libsmdb
libsmutil
libstand Define iaddr_t and saddr_t for arm. 2004-05-14 13:32:13 +00:00
libtacplus
libtelnet
libthr Make libthr async-signal-safe without costly signal masking. The guidlines I 2004-05-20 12:06:16 +00:00
libufs
libugidfw
libusbhid Add __BEGIN_DECLS / __END_DECLS so this can be used in C++ code. 2004-06-03 15:04:24 +00:00
libutil Humanize_number(3) is a part of libutil. 2004-05-25 20:11:50 +00:00
libvgl Signal handlers are supposed to take an int parameter. 2004-06-08 12:24:47 +00:00
libwrap
libxpg4
liby Include <stdlib.h> for exit() and add a prototype for yyparse(). 2004-05-24 09:50:57 +00:00
libypclnt
libz
msun Fix a bug where rintf() rounded the wrong way in round-to-nearest mode 2004-06-09 21:24:52 +00:00
ncurses
Makefile Style fixes: 2004-05-14 19:52:35 +00:00
Makefile.inc