libm: Sync with FreeBSD (~50 math functions added) The main purpose of syncing with FreeBSD is to obtain numerous "long double" functions which are required for C99 compliance. There are still many functions missing. According to g++ testsuite, the following 10 functions still must be implemented at least: coshl logl expl sinhl log2l expm1l acoshl log10l asinhl log1pl Also known missing are nexttowardl, tgammal, and the long double version of most of several complex functions. A few years ago the freebsd-based math library was thrown out in favor of the NetBSD version. It may be time to reverse that and sync the entire libm with FreeBSD. Right now the DragonFly libm is a mixture between the two and it doesn't divide nicely. All the rounding and rint functions from NetBSD had to be thrown out as well as the "kernel" functions. For the short term this is okay, but in the long term it would be a good idea to start tracking FreeBSD again. They are maintaining this library more frequently and adding more functions more rapidly than NetBSD, so it would be good to piggy-back on that effort. The man page will be committed separately.
libm: Sync with NetBSD Adds the following assembly function: logbl, ilogbl, modf, scalbnl Adds the following source functions: exp2, exp2f, frexp, nextafterl, nexttoward, requo, remquof, and fabsl Captures all the bug fixes since last sync Synchronizes with current NetBSD versions where possible. Required to fix modern gcc/fortran and other packages. Gets closer to C99 capability.
math.h: Convert HUGE_VALL to constant, from const-qualified var Define HUGE_VALL via a compiler builtin. If the compiler doesn't support it, we just fallback to previous situation. Both gcc and clang play well with it. This patch allows us to: 1. use HUGE_VALL as initializer element for objects with static storage duration 2. not worry about the format of long double (e.g., 96bit vs 128bit) 3. not worry about things like endianness Briefly-discussed-with: corecode@, swildner@, but put the blame on me if I broke something for you. Special-thanks-to: swildner@ for checking code with clang. P.S. HUGE_VAL{,F} already do the right thing.
FreeBSD and NetBSD both use derivates of Sun's math library. On FreeBSD, it's been put into lib/msun, on NetBSD it is under lib/libm. Since DragonFly misses a lot of the changes which went into both and I consider the NetBSD version cleaner, switch to that. Biggest difference to NetBSD is the omission of wrappers for non-IEEE757 floating point support. There's no point in supporting anything but IEEE 757 and that saves at least a function call per math entry point. Addtionally, important the fpclassify, isinf, isnan and signbit functions into libc as required for C99. Remove the support for non-POSIX operation. matherr is pointless and wasn't really supported anyway.