remove libm.h includes when math.h and float.h are enough

This commit is contained in:
nsz 2012-03-13 19:51:14 +01:00
parent df8b3e5aef
commit 9560b6b152
31 changed files with 47 additions and 30 deletions

View File

@ -1,4 +1,4 @@
#include "libm.h"
#include <math.h>
double fdim(double x, double y)
{

View File

@ -1,4 +1,4 @@
#include "libm.h"
#include <math.h>
float fdimf(float x, float y)
{

View File

@ -1,4 +1,5 @@
#include "libm.h"
#include <math.h>
#include <float.h>
#if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024
long double fdiml(long double x, long double y)

View File

@ -1,4 +1,4 @@
#include "libm.h"
#include <math.h>
double fmax(double x, double y)
{

View File

@ -1,4 +1,4 @@
#include "libm.h"
#include <math.h>
float fmaxf(float x, float y)
{

View File

@ -1,4 +1,5 @@
#include "libm.h"
#include <math.h>
#include <float.h>
#if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024
long double fmaxl(long double x, long double y)

View File

@ -1,4 +1,4 @@
#include "libm.h"
#include <math.h>
double fmin(double x, double y)
{

View File

@ -1,4 +1,4 @@
#include "libm.h"
#include <math.h>
float fminf(float x, float y)
{

View File

@ -1,4 +1,5 @@
#include "libm.h"
#include <math.h>
#include <float.h>
#if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024
long double fminl(long double x, long double y)

View File

@ -11,7 +11,6 @@ int ilogb(double x)
if (u.bits == 0)
return FP_ILOGB0;
/* subnormal x */
// FIXME: scale up subnormals with a *0x1p53 or find top set bit with a better method
for (e = -0x3ff; u.bits < (uint64_t)1<<63; e--, u.bits<<=1);
return e;
}

View File

@ -1,4 +1,4 @@
#include "libm.h"
#include <math.h>
double ldexp(double x, int n)
{

View File

@ -1,4 +1,4 @@
#include "libm.h"
#include <math.h>
float ldexpf(float x, int n)
{

View File

@ -1,4 +1,4 @@
#include "libm.h"
#include <math.h>
long double ldexpl(long double x, int n)
{

View File

@ -1,4 +1,6 @@
#include "libm.h"
#include <math.h>
#include <float.h>
#if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024
long long llrintl(long double x)
{

View File

@ -1,4 +1,6 @@
#include "libm.h"
#include <math.h>
#include <float.h>
#if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024
long long llroundl(long double x)
{

View File

@ -1,4 +1,6 @@
#include "libm.h"
#include <math.h>
#include <float.h>
#if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024
long lrintl(long double x)
{

View File

@ -1,4 +1,6 @@
#include "libm.h"
#include <math.h>
#include <float.h>
#if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024
long lroundl(long double x)
{

View File

@ -1,5 +1,5 @@
#include <fenv.h>
#include "libm.h"
#include <math.h>
/*
rint may raise inexact (and it should not alter the fenv otherwise)

View File

@ -1,5 +1,5 @@
#include <fenv.h>
#include "libm.h"
#include <math.h>
float nearbyintf(float x) {
fenv_t e;

View File

@ -1,4 +1,6 @@
#include "libm.h"
#include <math.h>
#include <float.h>
#if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024
long double nearbyintl(long double x)
{

View File

@ -11,6 +11,7 @@
*/
#include "libm.h"
#if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024
double nexttoward(double x, long double y)
{

View File

@ -1,4 +1,4 @@
#include "libm.h"
#include <math.h>
long double nexttowardl(long double x, long double y)
{

View File

@ -1,4 +1,5 @@
#include "libm.h"
#include <math.h>
#include <float.h>
#if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024
long double remainderl(long double x, long double y)

View File

@ -25,7 +25,7 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "libm.h"
#include <math.h>
double round(double x)
{

View File

@ -25,7 +25,7 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "libm.h"
#include <math.h>
float roundf(float x)
{

View File

@ -25,7 +25,9 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "libm.h"
#include <math.h>
#include <float.h>
#if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024
long double roundl(long double x)
{

View File

@ -15,7 +15,7 @@
* should use scalbn() instead.
*/
#include "libm.h"
#include <math.h>
double scalb(double x, double fn)
{

View File

@ -13,7 +13,7 @@
* ====================================================
*/
#include "libm.h"
#include <math.h>
float scalbf(float x, float fn)
{

View File

@ -1,5 +1,5 @@
#include <limits.h>
#include "libm.h"
#include <math.h>
double scalbln(double x, long n)
{

View File

@ -1,5 +1,5 @@
#include <limits.h>
#include "libm.h"
#include <math.h>
float scalblnf(float x, long n)
{

View File

@ -1,5 +1,6 @@
#include <limits.h>
#include "libm.h"
#include <math.h>
#include <float.h>
#if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024
long double scalblnl(long double x, long n)