freebsd-dev/lib
Bruce Evans 5792e54aa9 Fixed roundf(). The following cases never worked in FreeBSD:
- in round-towards-minus-infinity mode, on all machines, roundf(x) never
  worked for 0 < |x| < 0.5 (2*0x3effffff cases in all, or almost half of
  float space).  It was -0 for 0 < x < 0.5 and 0 for -0.5 < x < 0, but
  should be 0 and -0, respectively.  This is because t = ceilf(|x|) = 1
  for these args, and when we adjust t from 1 to 0 by subtracting 1, we
  get -0 in this rounding mode, but we want and expected to get 0.
- in round-towards-minus-infinity, round towards zero and round-to-nearest
  modes, on machines that evaluate float expressions in float precision
  (most machines except i386's), roundf(x) never worked for |x| =
  <float value immediately below 0.5> (2 cases in all).  It was +-1 but
  should have been +-0.  This is because t = ceilf(|x|) = 1 for these
  args, and when we try to classify |x| by subtracting it from 1 we
  get an unexpected rounding error -- the result is 0.5 after rounding
  to float in all 3 rounding modes, so we we have forgotten the
  difference between |x| and 0.5 and end up returning the same value
  as for +-0.5.

The fix is to use floorf() instead of ceilf() and to add 1 instead of
-1 in the adjustment.  With floorf() all the expressions used are
always evaluated exactly so there are no rounding problems, and with
adjustments of +1 we don't go near -0 when adjusting.

Attempted to fix round() and roundl() by cloning the fix for roundf().
This has only been tested for round(), only on args representable as
floats.  Double expressions are evaluated in double precision even on
i386's, so round(0.5-epsilon) was broken even on i386's.  roundl()
must be completely broken on i386's since long double precision is not
really supported.  There seem to be no other dependencies on the
precision.
2005-12-02 13:45:06 +00:00
..
bind Finish the removal of threads support in ../config.mk,v 1.15. 2005-11-07 15:22:35 +00:00
csu Fixed profiling of main() for amd64 and i386. This started rotting 2005-10-07 22:13:17 +00:00
libalias Bump the shared library version number of all libraries that have not 2005-07-22 17:19:05 +00:00
libarchive Portability: Remove AC_CHECK_MALLOC from configure.ac.in. 2005-11-27 03:16:46 +00:00
libatm Enforce style.Makefile(5). 2005-04-22 18:57:32 +00:00
libautofs Fix all the spelling mistakes I could find in the man pages for words 2005-07-31 03:30:48 +00:00
libbegemot Bump the shared library version number of all libraries that have not 2005-07-22 17:19:05 +00:00
libbluetooth Bump the shared library version number of all libraries that have not 2005-07-22 17:19:05 +00:00
libbsnmp Catch up with the import of bsnmp-1.11. Add a couple of new 2005-10-04 15:02:07 +00:00
libbz2 Bump the shared library version number of all libraries that have not 2005-07-22 17:19:05 +00:00
libc Fix markup. 2005-12-02 09:04:35 +00:00
libc_r - Prefix MUTEX_TYPE_MAX with PTHREAD_ to avoid namespace pollution. 2005-08-19 21:31:42 +00:00
libcalendar Mechanically kill hard sentence breaks. 2004-07-02 23:52:20 +00:00
libcam Better memory handling: 2005-07-13 10:40:07 +00:00
libcom_err
libcompat Expand contractions. 2005-02-13 23:45:54 +00:00
libcrypt Bump the shared library version number of all libraries that have not 2005-07-22 17:19:05 +00:00
libdevinfo Add __BEGIN_DECLS/__END_DECLS so that this header can be included in C++ 2005-08-31 14:57:39 +00:00
libdevstat Remove an unused variable. 2005-10-04 22:00:35 +00:00
libdisk Fix prototypes. 2005-11-24 10:30:44 +00:00
libedit Fix prototype. 2005-11-24 10:32:39 +00:00
libexpat Bump the shared library version number of all libraries that have not 2005-07-22 17:19:05 +00:00
libfetch Fix misspelling in Poul-Henning Kamp's email address under AUTHORS, from 2005-11-30 04:08:45 +00:00
libform Add missing shared library interdependencies. 2005-11-10 18:07:07 +00:00
libftpio Bump the shared library version number of all libraries that have not 2005-07-22 17:19:05 +00:00
libgeom Fix prototype. 2005-11-24 10:43:35 +00:00
libgpib Bump the shared library version number of all libraries that have not 2005-07-22 17:19:05 +00:00
libio Start the dreaded NOFOO -> NO_FOO conversion. 2004-12-21 08:47:35 +00:00
libipsec Bump the shared library version number of all libraries that have not 2005-07-22 17:19:05 +00:00
libipx Various markup and spelling fixes. 2004-12-29 02:18:24 +00:00
libkiconv - Fix checking range of strings of struct iconv_add_in in libsmb and libkiconv, 2005-08-24 12:38:26 +00:00
libkse o Include <sys/time.h> 2005-11-19 04:47:06 +00:00
libkvm Fix a well duplicated fencepost error that stopped crashdumps being 2005-10-20 05:41:38 +00:00
libmagic Add missing shared library interdependencies. 2005-11-10 18:07:07 +00:00
libmd -mdoc sweep. 2005-11-17 13:00:00 +00:00
libmemstat Tidy up markup and fix two bugs. 2005-11-21 17:18:34 +00:00
libmenu Add missing shared library interdependencies. 2005-11-10 18:07:07 +00:00
libmilter NOINET6 -> NO_INET6 2004-12-21 10:49:29 +00:00
libmp Add missing shared library interdependencies. 2005-11-10 18:07:07 +00:00
libncp Add missing shared library interdependencies. 2005-11-10 18:07:07 +00:00
libncurses Bump the shared library version number of all libraries that have not 2005-07-22 17:19:05 +00:00
libnetgraph Recognize all current standard node types. 2005-10-25 20:58:30 +00:00
libngatm Bump the shared library version number of all libraries that have not 2005-07-22 17:19:05 +00:00
libopie Bump the shared library version number of all libraries that have not 2005-07-22 17:19:05 +00:00
libpam Commenting out WARNS actually brought it up to 4. 2005-09-28 14:36:16 +00:00
libpanel Add missing shared library interdependencies. 2005-11-10 18:07:07 +00:00
libpcap bump SHLIB_MAJOR as libpcap refers getnetbyname(3). 2005-06-03 09:41:26 +00:00
libpmc Fix prototypes. 2005-11-24 10:54:47 +00:00
libpthread o Include <sys/time.h> 2005-11-19 04:47:06 +00:00
libradius Add missing shared library interdependencies. 2005-11-10 18:07:07 +00:00
librpcsvc Fix the source path. 2005-06-04 10:48:21 +00:00
libsbuf style.Makefile(5) 2003-08-18 15:25:39 +00:00
libsdp Bump the shared library version number of all libraries that have not 2005-07-22 17:19:05 +00:00
libsm Add a new source file in sendmail 8.13.4 2005-06-07 04:18:25 +00:00
libsmb Add missing shared library interdependencies. 2005-11-10 18:07:07 +00:00
libsmdb For variables that are only checked with defined(), don't provide 2004-10-24 15:33:08 +00:00
libsmutil For variables that are only checked with defined(), don't provide 2004-10-24 15:33:08 +00:00
libstand Fix prototypes. 2005-11-24 11:14:06 +00:00
libtacplus Bump the shared library version number of all libraries that have not 2005-07-22 17:19:05 +00:00
libtelnet NOCRYPT -> NO_CRYPT 2004-12-21 10:16:04 +00:00
libthr Fix name compatible problem with POSIX standard. the sigval_ptr and 2005-11-04 09:41:00 +00:00
libthread_db Bump the shared library version number of all libraries that have not 2005-07-22 17:19:05 +00:00
libufs minor style.Makefile(5) fixes: 2005-09-26 06:23:43 +00:00
libugidfw Bump the shared library version number of all libraries that have not 2005-07-22 17:19:05 +00:00
libusbhid Fix prototypes. 2005-11-24 11:26:36 +00:00
libutil Restore the previous state after a FILL operation in properties_read() 2005-11-28 16:30:16 +00:00
libvgl Bump the shared library version number of all libraries that have not 2005-07-22 17:19:05 +00:00
libwrap Bump the shared library version number of all libraries that have not 2005-07-22 17:19:05 +00:00
liby Drop useless with NO_PIC SHLIB_MAJOR. 2005-07-20 14:35:26 +00:00
libypclnt Bump the shared library version number of all libraries that have not 2005-07-22 17:19:05 +00:00
libz Correct a buffer overflow which can occur when decompressing a 2005-07-27 08:41:17 +00:00
msun Fixed roundf(). The following cases never worked in FreeBSD: 2005-12-02 13:45:06 +00:00
ncurses Add missing shared library interdependencies. 2005-11-10 18:07:07 +00:00
Makefile Disconnect libc_r from buildworld, it is still kept in the tree to 2005-10-27 03:09:20 +00:00
Makefile.inc Bump the shared library version number of all libraries that have not 2005-07-22 17:19:05 +00:00