summaryrefslogtreecommitdiffstats
path: root/lib/msun/bsdsrc
Commit message (Collapse)AuthorAgeFilesLines
* Eliminate some warnings.das2008-02-223-9/+3
|
* Fix tgamma() on some special args:bde2007-05-021-14/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | (1) tgamma(-Inf) returned +Inf and failed to raise any exception, but should always have raised an exception, and should behave like tgamma(negative integer). (2) tgamma(negative integer) returned +Inf and raised divide-by-zero, but should return NaN and raise "invalid" on any IEEEish system. (3) About half of the 2**52 negative intgers between -2**53 and -2**52 were misclassified as non-integers by using floor(x + 0.5) to round to nearest, so tgamma(x) was wrong (+-0 instead of +Inf and now NaN) on these args. The floor() expression is hard to use since rounding of (x + 0.5) may give x or x + 1, depending on |x| and the current rounding mode. The fixed version uses ceil(x) to classify x before operating on x and ends up being more efficient since ceil(x) is needed anyway. (4) On at least the problematic args in (3), tgamma() raised a spurious inexact. (5) tgamma(large positive) raised divide-by-zero but should raise overflow. (6) tgamma(+Inf) raised divide-by-zero but should not raise any exception. (7) Raise inexact for tiny |x| in a way that has some chance of not being optimized away. The fix for (5) and (6), and probably for (2), also prevents -O optimizing away the exception. PR: 112180 (2) Standards: Annex F in C99 (IEC 60559 binding) requires (1), (2) and (6).
* Document (in a comment) the current (slightly broken) handling of specialbde2007-05-021-6/+9
| | | | | | | | | | | | | | | | | | | | | | values in more detail, and change the style of this comment to be closer to fdlibm and C99: - tgamma(-Inf) was undocumented and is wrong (+Inf, should be NaN) - tgamma(negative integer) is as intended (+Inf) but not best for IEEE-754 (NaN) - tgamma(-0) was documented as being wrong (+Inf) but was correct (-Inf) - documentation of setting of exceptions (overflow, etc.) was more complete here than in most of libm, but was further from matching the actual setting than in most of libm, due to various bugs here (primarily, always evaluating +Inf one/zero and getting unwanted divide-by-zero exceptions from this). Now the actual behaviour with gcc -O0 is documented. Optimization still breaks setting of exceptions all over libm, so nothing can depend on this working. - tgamma(NaN)'s exception was documented as being wrong (invalid) but was correct (no exception with IEEEish NaNs). Finish (?) rev.1.5. gamma was not renamed to tgamma in one place. Finish (?) rev.1.6. errno.h was not completely removed.
* Removed an unused declaration which was so old that it wasn't a prototypebde2005-11-181-4/+6
| | | | | | and thus just broke building at any nonzero WARNS level. Fixed nearby style bugs.
* Fixed aliasing bugs in TRUNC() by using the fdlibm macros for accessbde2005-09-193-12/+26
| | | | | | | | | | | | | | | | | | | | to doubles as bits. fdlibm-1.1 had similar aliasing bugs, but these were fixed by NetBSD or Cygnus before a modified version of fdlibm was imported in 1994. TRUNC() is only used by tgamma() and some implementation-detail functions. The aliasing bugs were detected by compiling with gcc -O2 but don't seem to have broken tgamma() on i386's or amd64's. They broke my modified version of tgamma(). Moved the definition of TRUNC() to mathimpl.h so that it can be fixed in one place, although the general version is even slower than necessary because it has to operate on pointers to volatiles to handle its arg sometimes being volatile. Inefficiency of the fdlibm macros slows down libm generally, and tgamma() is a relatively unimportant part of libm. The macros act as if on 32-bit words in memory, so they are hard to optimize to direct actions on 64-bit double registers for (non-i386) machines where this is possible. The optimization is too hard for gcc on amd64's, and declaring variables as volatile makes it impossible.
* GC unused declarationdas2004-12-161-1/+0
|
* Cosmetic changes only:das2004-12-163-45/+15
| | | | | | | | - style - remove unused variables - de-support VAX Inspired by: bin/42388
* Remove some kludges designed to ensure that the compiler didn't rounddas2004-05-172-87/+10
| | | | | | | | | | constants the wrong way on the VAX. Instead, use C99 hexadecimal floating-point constants, which are guaranteed to be exact on binary IEEE machines. (The correct hexadecimal values were already provided in the source, but not used.) Also, convert the constants to lowercase to work around a gcc bug that wasn't fixed until gcc 3.4.0. Prompted by: stefanf
* Correct typos, mostly s/ a / an / where appropriate. Some whitespace cleanup,schweikh2003-01-011-1/+1
| | | | especially in troff files.
* Assume __STDC__, remove non-__STDC__ code.alfred2002-05-281-4/+0
| | | | Submitted by: keramida
* Resurrect Lite1's gamma() as C99's tgamma(). Minimal changes.bde2002-03-263-5/+9
|
* Remove __P() usage.obrien2002-03-212-7/+8
|
* Fix SCM ID's.obrien2002-03-213-9/+7
|
* Add __FBSDID()s to libmdillon2001-09-303-0/+9
|
* Remove trailing whitespace.rgrimes1995-05-302-11/+11
|
* BSD 4.4 Lite Lib Sourcesrgrimes1994-05-274-0/+1123
OpenPOWER on IntegriCloud