mirror of
https://git.planet-casio.com/Lephenixnoir/OpenLibm.git
synced 2024-12-29 13:03:42 +01:00
address compiler warnings in #3
This commit is contained in:
parent
f0862df1db
commit
04e12006e5
18 changed files with 29 additions and 57 deletions
|
@ -71,7 +71,7 @@ __ieee754_atan2(double y, double x)
|
|||
if(((ix|((lx|-lx)>>31))>0x7ff00000)||
|
||||
((iy|((ly|-ly)>>31))>0x7ff00000)) /* x or y is NaN */
|
||||
return x+y;
|
||||
if((hx-0x3ff00000|lx)==0) return atan(y); /* x=1.0 */
|
||||
if(((hx-0x3ff00000)|lx)==0) return atan(y); /* x=1.0 */
|
||||
m = ((hy>>31)&1)|((hx>>30)&2); /* 2*sign(x)+sign(y) */
|
||||
|
||||
/* when y = 0 */
|
||||
|
|
|
@ -13,10 +13,6 @@
|
|||
* ====================================================
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
static char rcsid[] = "$FreeBSD: src/lib/msun/src/e_sqrtf.c,v 1.7 2002/05/28 18:15:04 alfred Exp $";
|
||||
#endif
|
||||
|
||||
#include "openlibm.h"
|
||||
#include "math_private.h"
|
||||
|
||||
|
|
|
@ -65,7 +65,9 @@ dec(long double x)
|
|||
return (u.e);
|
||||
}
|
||||
|
||||
#ifndef __GNUC__
|
||||
#pragma STDC FENV_ACCESS ON
|
||||
#endif
|
||||
|
||||
/*
|
||||
* This is slow, but simple and portable. You should use hardware sqrt
|
||||
|
|
|
@ -40,7 +40,9 @@
|
|||
* gcc generates is acceptable, since the special cases have already been
|
||||
* handled.
|
||||
*/
|
||||
#ifndef __GNUC__
|
||||
#pragma STDC CX_LIMITED_RANGE ON
|
||||
#endif
|
||||
|
||||
/* We risk spurious overflow for components >= DBL_MAX / (1 + sqrt(2)). */
|
||||
#define THRESH 0x1.a827999fcef32p+1022
|
||||
|
|
|
@ -39,7 +39,9 @@
|
|||
* gcc generates is acceptable, since the special cases have already been
|
||||
* handled.
|
||||
*/
|
||||
#ifndef __GNUC__
|
||||
#pragma STDC CX_LIMITED_RANGE ON
|
||||
#endif
|
||||
|
||||
float complex
|
||||
csqrtf(float complex z)
|
||||
|
|
|
@ -25,7 +25,6 @@
|
|||
*/
|
||||
|
||||
#include "cdefs-compat.h"
|
||||
//__FBSDID("$FreeBSD: src/lib/msun/src/s_csqrtl.c,v 1.2 2008/08/08 00:15:16 das Exp $");
|
||||
|
||||
#include <complex.h>
|
||||
#include <float.h>
|
||||
|
@ -40,7 +39,9 @@
|
|||
* gcc generates is acceptable, since the special cases have already been
|
||||
* handled.
|
||||
*/
|
||||
#ifndef __GNUC__
|
||||
#pragma STDC CX_LIMITED_RANGE ON
|
||||
#endif
|
||||
|
||||
/* We risk spurious overflow for components >= LDBL_MAX / (1 + sqrt(2)). */
|
||||
#define THRESH (LDBL_MAX / 2.414213562373095048801688724209698L)
|
||||
|
|
|
@ -10,10 +10,6 @@
|
|||
* ====================================================
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
static char rcsid[] = "$FreeBSD: src/lib/msun/src/s_fabs.c,v 1.7 2002/05/28 18:15:04 alfred Exp $";
|
||||
#endif
|
||||
|
||||
/*
|
||||
* fabs(x) returns the absolute value of x.
|
||||
*/
|
||||
|
|
|
@ -117,7 +117,7 @@ add_and_denormalize(double a, double b, int scale)
|
|||
if (sum.lo != 0) {
|
||||
EXTRACT_WORD64(hibits, sum.hi);
|
||||
bits_lost = -((int)(hibits >> 52) & 0x7ff) - scale + 1;
|
||||
if (bits_lost != 1 ^ (int)(hibits & 1)) {
|
||||
if ((bits_lost != 1) ^ (int)(hibits & 1)) {
|
||||
/* hibits += (int)copysign(1.0, sum.hi * sum.lo) */
|
||||
EXTRACT_WORD64(lobits, sum.lo);
|
||||
hibits += 1 - (((hibits ^ lobits) >> 62) & 2);
|
||||
|
@ -216,17 +216,17 @@ fma(double x, double y, double z)
|
|||
case FE_TONEAREST:
|
||||
return (z);
|
||||
case FE_TOWARDZERO:
|
||||
if (x > 0.0 ^ y < 0.0 ^ z < 0.0)
|
||||
if ((x > 0.0) ^ (y < 0.0) ^ (z < 0.0))
|
||||
return (z);
|
||||
else
|
||||
return (nextafter(z, 0));
|
||||
case FE_DOWNWARD:
|
||||
if (x > 0.0 ^ y < 0.0)
|
||||
if ((x > 0.0) ^ (y < 0.0))
|
||||
return (z);
|
||||
else
|
||||
return (nextafter(z, -INFINITY));
|
||||
default: /* FE_UPWARD */
|
||||
if (x > 0.0 ^ y < 0.0)
|
||||
if ((x > 0.0) ^ (y < 0.0))
|
||||
return (nextafter(z, INFINITY));
|
||||
else
|
||||
return (z);
|
||||
|
|
|
@ -113,7 +113,7 @@ add_and_denormalize(long double a, long double b, int scale)
|
|||
if (sum.lo != 0) {
|
||||
u.e = sum.hi;
|
||||
bits_lost = -u.bits.exp - scale + 1;
|
||||
if (bits_lost != 1 ^ (int)(u.bits.manl & 1))
|
||||
if ((bits_lost != 1) ^ (int)(u.bits.manl & 1))
|
||||
sum.hi = nextafterl(sum.hi, INFINITY * sum.lo);
|
||||
}
|
||||
return (ldexp(sum.hi, scale));
|
||||
|
@ -204,17 +204,17 @@ fmal(long double x, long double y, long double z)
|
|||
case FE_TONEAREST:
|
||||
return (z);
|
||||
case FE_TOWARDZERO:
|
||||
if (x > 0.0 ^ y < 0.0 ^ z < 0.0)
|
||||
if ((x > 0.0) ^ (y < 0.0) ^ (z < 0.0))
|
||||
return (z);
|
||||
else
|
||||
return (nextafterl(z, 0));
|
||||
case FE_DOWNWARD:
|
||||
if (x > 0.0 ^ y < 0.0)
|
||||
if ((x > 0.0) ^ (y < 0.0))
|
||||
return (z);
|
||||
else
|
||||
return (nextafterl(z, -INFINITY));
|
||||
default: /* FE_UPWARD */
|
||||
if (x > 0.0 ^ y < 0.0)
|
||||
if ((x > 0.0) ^ (y < 0.0))
|
||||
return (nextafterl(z, INFINITY));
|
||||
else
|
||||
return (z);
|
||||
|
|
|
@ -29,17 +29,6 @@
|
|||
|
||||
#include "fpmath.h"
|
||||
|
||||
//#define FP_INFINITE 0x01
|
||||
//#define FP_NAN 0x02
|
||||
//#define FP_NORMAL 0x04
|
||||
//#define FP_SUBNORMAL 0x08
|
||||
//#define FP_ZERO 0x10
|
||||
//#define fpclassify(x) \
|
||||
// ((sizeof (x) == sizeof (float)) ? __fpclassifyf(x) \
|
||||
// : (sizeof (x) == sizeof (double)) ? __fpclassifyd(x) \
|
||||
// : __fpclassifyl(x))
|
||||
//
|
||||
|
||||
int
|
||||
__fpclassifyd(double d)
|
||||
{
|
||||
|
|
|
@ -10,10 +10,6 @@
|
|||
* ====================================================
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
static char rcsid[] = "$FreeBSD: src/lib/msun/src/s_logbl.c,v 1.1 2007/12/17 03:53:38 das Exp $";
|
||||
#endif
|
||||
|
||||
#include <float.h>
|
||||
#include <limits.h>
|
||||
#include <openlibm.h>
|
||||
|
|
|
@ -10,10 +10,6 @@
|
|||
* ====================================================
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
static char rcsid[] = "$FreeBSD: src/lib/msun/src/s_modf.c,v 1.8 2007/01/06 21:22:38 das Exp $";
|
||||
#endif
|
||||
|
||||
/*
|
||||
* modf(double x, double *iptr)
|
||||
* return fraction part of x, and return x's integral part in *iptr.
|
||||
|
|
|
@ -52,7 +52,7 @@ nextafterl(long double x, long double y)
|
|||
t = ux.e*ux.e;
|
||||
if(t==ux.e) return t; else return ux.e; /* raise underflow flag */
|
||||
}
|
||||
if(x>0.0 ^ x<y) { /* x -= ulp */
|
||||
if((x>0.0) ^ (x<y)) { /* x -= ulp */
|
||||
if(ux.bits.manl==0) {
|
||||
if ((ux.bits.manh&~LDBL_NBIT)==0)
|
||||
ux.bits.exp -= 1;
|
||||
|
|
|
@ -51,7 +51,7 @@ nexttoward(double x, long double y)
|
|||
t = x*x;
|
||||
if(t==x) return t; else return x; /* raise underflow flag */
|
||||
}
|
||||
if(hx>0.0 ^ x < y) { /* x -= ulp */
|
||||
if((hx>0.0) ^ (x < y)) { /* x -= ulp */
|
||||
if(lx==0) hx -= 1;
|
||||
lx -= 1;
|
||||
} else { /* x += ulp */
|
||||
|
|
|
@ -41,7 +41,7 @@ nexttowardf(float x, long double y)
|
|||
t = x*x;
|
||||
if(t==x) return t; else return x; /* raise underflow flag */
|
||||
}
|
||||
if(hx>=0 ^ x < y) /* x -= ulp */
|
||||
if((hx>=0) ^ (x < y)) /* x -= ulp */
|
||||
hx -= 1;
|
||||
else /* x += ulp */
|
||||
hx += 1;
|
||||
|
|
|
@ -10,10 +10,6 @@
|
|||
* ====================================================
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
static char rcsid[] = "$FreeBSD: src/lib/msun/src/s_scalbn.c,v 1.11 2005/03/07 21:27:37 das Exp $";
|
||||
#endif
|
||||
|
||||
/*
|
||||
* scalbn (double x, int n)
|
||||
* scalbn(x,n) returns x* 2**n computed by exponent
|
||||
|
@ -51,10 +47,11 @@ scalbn (double x, int n)
|
|||
if (k > 0x7fe) return huge*copysign(huge,x); /* overflow */
|
||||
if (k > 0) /* normal result */
|
||||
{SET_HIGH_WORD(x,(hx&0x800fffff)|(k<<20)); return x;}
|
||||
if (k <= -54)
|
||||
if (k <= -54) {
|
||||
if (n > 50000) /* in case integer overflow in n+k */
|
||||
return huge*copysign(huge,x); /*overflow*/
|
||||
else return tiny*copysign(tiny,x); /*underflow*/
|
||||
}
|
||||
k += 54; /* subnormal result */
|
||||
SET_HIGH_WORD(x,(hx&0x800fffff)|(k<<20));
|
||||
return x*twom54;
|
||||
|
|
|
@ -13,9 +13,6 @@
|
|||
* ====================================================
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
static char rcsid[] = "$FreeBSD: src/lib/msun/src/s_scalbnf.c,v 1.8 2005/03/07 04:52:43 das Exp $";
|
||||
#endif
|
||||
|
||||
#include "cdefs-compat.h"
|
||||
|
||||
|
@ -46,10 +43,11 @@ scalbnf (float x, int n)
|
|||
if (k > 0xfe) return huge*copysignf(huge,x); /* overflow */
|
||||
if (k > 0) /* normal result */
|
||||
{SET_FLOAT_WORD(x,(ix&0x807fffff)|(k<<23)); return x;}
|
||||
if (k <= -25)
|
||||
if (k <= -25) {
|
||||
if (n > 50000) /* in case integer overflow in n+k */
|
||||
return huge*copysignf(huge,x); /*overflow*/
|
||||
else return tiny*copysignf(tiny,x); /*underflow*/
|
||||
}
|
||||
k += 25; /* subnormal result */
|
||||
SET_FLOAT_WORD(x,(ix&0x807fffff)|(k<<23));
|
||||
return x*twom25;
|
||||
|
|
|
@ -10,10 +10,6 @@
|
|||
* ====================================================
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
static char rcsid[] = "$FreeBSD: src/lib/msun/src/s_scalbnl.c,v 1.1 2005/03/07 04:52:58 das Exp $";
|
||||
#endif
|
||||
|
||||
/*
|
||||
* scalbnl (long double x, int n)
|
||||
* scalbnl(x,n) returns x* 2**n computed by exponent
|
||||
|
@ -59,10 +55,11 @@ scalbnl (long double x, int n)
|
|||
if (k >= 0x7fff) return huge*copysignl(huge,x); /* overflow */
|
||||
if (k > 0) /* normal result */
|
||||
{u.bits.exp = k; return u.e;}
|
||||
if (k <= -128)
|
||||
if (k <= -128) {
|
||||
if (n > 50000) /* in case integer overflow in n+k */
|
||||
return huge*copysign(huge,x); /*overflow*/
|
||||
else return tiny*copysign(tiny,x); /*underflow*/
|
||||
}
|
||||
k += 128; /* subnormal result */
|
||||
u.bits.exp = k;
|
||||
return u.e*0x1p-128;
|
||||
|
|
Loading…
Reference in a new issue