Remove HUGE_VAL definition from libm math functions
This patch removes the definitions of HUGE_VAL from some of the float math functions. HUGE_VAL is defined in newlib/libc/include/math.h, so it is not necessary to have a further definition in the math functions.
This commit is contained in:
parent
b14a879d85
commit
7db203304e
|
@ -52,12 +52,6 @@ hypotl (long double x, long double y)
|
|||
if ((! finitel (z)) && finitel (x) && finitel (y))
|
||||
{
|
||||
/* hypot (finite, finite) overflow. */
|
||||
#ifndef HUGE_VAL
|
||||
#define HUGE_VAL inf
|
||||
double inf = 0.0;
|
||||
|
||||
SET_HIGH_WORD (inf, 0x7ff00000); /* Set inf to infinite. */
|
||||
#endif
|
||||
errno = ERANGE;
|
||||
return (long double) HUGE_VAL;
|
||||
}
|
||||
|
|
|
@ -86,12 +86,6 @@ static double zero = 0.0; /* used as const */
|
|||
#endif
|
||||
{
|
||||
double retval = 0.0;
|
||||
#ifndef HUGE_VAL /* this is the only routine that uses HUGE_VAL */
|
||||
#define HUGE_VAL inf
|
||||
double inf = 0.0;
|
||||
|
||||
SET_HIGH_WORD(inf,0x7ff00000); /* set inf to infinite */
|
||||
#endif
|
||||
|
||||
#ifdef _USE_WRITE
|
||||
/* (void) fflush(_stdout_r(p)); */
|
||||
|
|
|
@ -74,12 +74,6 @@ QUICKREF
|
|||
if(_LIB_VERSION == _IEEE_ || isnan(x)) return z;
|
||||
if(fabs(x)>7.10475860073943863426e+02) {
|
||||
/* cosh(finite) overflow */
|
||||
#ifndef HUGE_VAL
|
||||
#define HUGE_VAL inf
|
||||
double inf = 0.0;
|
||||
|
||||
SET_HIGH_WORD(inf,0x7ff00000); /* set inf to infinite */
|
||||
#endif
|
||||
errno = ERANGE;
|
||||
return HUGE_VAL;
|
||||
} else
|
||||
|
|
|
@ -79,12 +79,6 @@ u_threshold= -7.45133219101941108420e+02; /* 0xc0874910, 0xD52D3051 */
|
|||
if(finite(x)) {
|
||||
if(x>o_threshold) {
|
||||
/* exp(finite) overflow */
|
||||
#ifndef HUGE_VAL
|
||||
#define HUGE_VAL inf
|
||||
double inf = 0.0;
|
||||
|
||||
SET_HIGH_WORD(inf,0x7ff00000); /* set inf to infinite */
|
||||
#endif
|
||||
errno = ERANGE;
|
||||
return HUGE_VAL;
|
||||
} else if(x<u_threshold) {
|
||||
|
|
|
@ -155,12 +155,6 @@ in terms of the base return values, although the <[signgam]> global for
|
|||
y = __ieee754_gamma_r(x,&(_REENT_SIGNGAM(_REENT)));
|
||||
if(_LIB_VERSION == _IEEE_) return y;
|
||||
if(!finite(y)&&finite(x)) {
|
||||
#ifndef HUGE_VAL
|
||||
#define HUGE_VAL inf
|
||||
double inf = 0.0;
|
||||
|
||||
SET_HIGH_WORD(inf,0x7ff00000); /* set inf to infinite */
|
||||
#endif
|
||||
if(floor(x)==x&&x<=0.0) {
|
||||
/* gamma(-integer) or gamma(0) */
|
||||
errno = EDOM;
|
||||
|
|
|
@ -68,12 +68,6 @@ PORTABILITY
|
|||
if(_LIB_VERSION == _IEEE_) return z;
|
||||
if((!finite(z))&&finite(x)&&finite(y)) {
|
||||
/* hypot(finite,finite) overflow */
|
||||
#ifndef HUGE_VAL
|
||||
#define HUGE_VAL inf
|
||||
double inf = 0.0;
|
||||
|
||||
SET_HIGH_WORD(inf,0x7ff00000); /* set inf to infinite */
|
||||
#endif
|
||||
errno = ERANGE;
|
||||
return HUGE_VAL;
|
||||
} else
|
||||
|
|
|
@ -129,12 +129,6 @@ None of the Bessel functions are in ANSI C.
|
|||
z = __ieee754_y0(x);
|
||||
if(_LIB_VERSION == _IEEE_ || isnan(x) ) return z;
|
||||
if(x <= 0.0){
|
||||
#ifndef HUGE_VAL
|
||||
#define HUGE_VAL inf
|
||||
double inf = 0.0;
|
||||
|
||||
SET_HIGH_WORD(inf,0x7ff00000); /* set inf to infinite */
|
||||
#endif
|
||||
/* y0(0) = -inf or y0(x<0) = NaN */
|
||||
errno = EDOM;
|
||||
return -HUGE_VAL;
|
||||
|
|
|
@ -56,12 +56,6 @@
|
|||
z = __ieee754_y1(x);
|
||||
if(_LIB_VERSION == _IEEE_ || isnan(x) ) return z;
|
||||
if(x <= 0.0){
|
||||
#ifndef HUGE_VAL
|
||||
#define HUGE_VAL inf
|
||||
double inf = 0.0;
|
||||
|
||||
SET_HIGH_WORD(inf,0x7ff00000); /* set inf to infinite */
|
||||
#endif
|
||||
/* y1(0) = -inf or y1(x<0) = NaN */
|
||||
errno = EDOM;
|
||||
return -HUGE_VAL;
|
||||
|
|
|
@ -79,12 +79,6 @@
|
|||
if(_LIB_VERSION == _IEEE_ || isnan(x) ) return z;
|
||||
if(x <= 0.0){
|
||||
/* yn(n,0) = -inf or yn(x<0) = NaN */
|
||||
#ifndef HUGE_VAL
|
||||
#define HUGE_VAL inf
|
||||
double inf = 0.0;
|
||||
|
||||
SET_HIGH_WORD(inf,0x7ff00000); /* set inf to infinite */
|
||||
#endif
|
||||
errno = EDOM;
|
||||
return -HUGE_VAL;
|
||||
}
|
||||
|
|
|
@ -38,12 +38,6 @@
|
|||
y = __ieee754_lgamma_r(x,&(_REENT_SIGNGAM(_REENT)));
|
||||
if(_LIB_VERSION == _IEEE_) return y;
|
||||
if(!finite(y)&&finite(x)) {
|
||||
#ifndef HUGE_VAL
|
||||
#define HUGE_VAL inf
|
||||
double inf = 0.0;
|
||||
|
||||
SET_HIGH_WORD(inf,0x7ff00000); /* set inf to infinite */
|
||||
#endif
|
||||
if(floor(x)==x&&x<=0.0)
|
||||
/* lgamma(-integer) */
|
||||
errno = EDOM;
|
||||
|
|
|
@ -63,12 +63,6 @@ PORTABILITY
|
|||
double z;
|
||||
z = __ieee754_log(x);
|
||||
if(_LIB_VERSION == _IEEE_ || isnan(x) || x > 0.0) return z;
|
||||
#ifndef HUGE_VAL
|
||||
#define HUGE_VAL inf
|
||||
double inf = 0.0;
|
||||
|
||||
SET_HIGH_WORD(inf,0x7ff00000); /* set inf to infinite */
|
||||
#endif
|
||||
if(x==0.0) {
|
||||
/* log(0) */
|
||||
errno = ERANGE;
|
||||
|
|
|
@ -64,12 +64,6 @@ PORTABILITY
|
|||
z = __ieee754_log10(x);
|
||||
if(_LIB_VERSION == _IEEE_ || isnan(x)) return z;
|
||||
if(x<=0.0) {
|
||||
#ifndef HUGE_VAL
|
||||
#define HUGE_VAL inf
|
||||
double inf = 0.0;
|
||||
|
||||
SET_HIGH_WORD(inf,0x7ff00000); /* set inf to infinite */
|
||||
#endif
|
||||
if(x==0.0) {
|
||||
/* log10(0) */
|
||||
errno = ERANGE;
|
||||
|
|
|
@ -66,12 +66,6 @@ PORTABILITY
|
|||
return __ieee754_pow(x,y);
|
||||
#else
|
||||
double z;
|
||||
#ifndef HUGE_VAL
|
||||
#define HUGE_VAL inf
|
||||
double inf = 0.0;
|
||||
|
||||
SET_HIGH_WORD(inf,0x7ff00000); /* set inf to infinite */
|
||||
#endif
|
||||
z=__ieee754_pow(x,y);
|
||||
if(_LIB_VERSION == _IEEE_|| isnan(y)) return z;
|
||||
if(isnan(x)) {
|
||||
|
|
|
@ -41,12 +41,6 @@
|
|||
return __ieee754_scalb(x,fn);
|
||||
#else
|
||||
double z;
|
||||
#ifndef HUGE_VAL
|
||||
#define HUGE_VAL inf
|
||||
double inf = 0.0;
|
||||
|
||||
SET_HIGH_WORD(inf,0x7ff00000); /* set inf to infinite */
|
||||
#endif
|
||||
z = __ieee754_scalb(x,fn);
|
||||
if(_LIB_VERSION == _IEEE_) return z;
|
||||
if(!(finite(z)||isnan(z))&&finite(x)) {
|
||||
|
|
|
@ -79,12 +79,6 @@ QUICKREF
|
|||
if(_LIB_VERSION == _IEEE_) return z;
|
||||
if(!finite(z)&&finite(x)) {
|
||||
/* sinh(finite) overflow */
|
||||
#ifndef HUGE_VAL
|
||||
#define HUGE_VAL inf
|
||||
double inf = 0.0;
|
||||
|
||||
SET_HIGH_WORD(inf,0x7ff00000); /* set inf to infinite */
|
||||
#endif
|
||||
errno = ERANGE;
|
||||
return ((x>0.0) ? HUGE_VAL : -HUGE_VAL);
|
||||
} else
|
||||
|
|
|
@ -35,12 +35,6 @@
|
|||
if(_LIB_VERSION == _IEEE_ || isnan(x)) return z;
|
||||
if(fabsf(x)>8.9415985107e+01f) {
|
||||
/* coshf(finite) overflow */
|
||||
#ifndef HUGE_VAL
|
||||
#define HUGE_VAL inf
|
||||
double inf = 0.0;
|
||||
|
||||
SET_HIGH_WORD(inf,0x7ff00000); /* set inf to infinite */
|
||||
#endif
|
||||
errno = ERANGE;
|
||||
return (float)HUGE_VAL;
|
||||
} else
|
||||
|
|
|
@ -45,12 +45,6 @@ u_threshold= -1.0397208405e+02; /* 0xc2cff1b5 */
|
|||
if(finitef(x)) {
|
||||
if(x>o_threshold) {
|
||||
/* expf(finite) overflow */
|
||||
#ifndef HUGE_VAL
|
||||
#define HUGE_VAL inf
|
||||
double inf = 0.0;
|
||||
|
||||
SET_HIGH_WORD(inf,0x7ff00000); /* set inf to infinite */
|
||||
#endif
|
||||
errno = ERANGE;
|
||||
return HUGE_VAL;
|
||||
} else if(x<u_threshold) {
|
||||
|
|
|
@ -32,12 +32,6 @@
|
|||
y = __ieee754_gammaf_r(x,&(_REENT_SIGNGAM(_REENT)));
|
||||
if(_LIB_VERSION == _IEEE_) return y;
|
||||
if(!finitef(y)&&finitef(x)) {
|
||||
#ifndef HUGE_VAL
|
||||
#define HUGE_VAL inf
|
||||
double inf = 0.0;
|
||||
|
||||
SET_HIGH_WORD(inf,0x7ff00000); /* set inf to infinite */
|
||||
#endif
|
||||
if(floorf(x)==x&&x<=0.0f) {
|
||||
/* gammaf(-integer) or gammaf(0) */
|
||||
errno = EDOM;
|
||||
|
|
|
@ -35,12 +35,6 @@
|
|||
if(_LIB_VERSION == _IEEE_) return z;
|
||||
if((!finitef(z))&&finitef(x)&&finitef(y)) {
|
||||
/* hypotf(finite,finite) overflow */
|
||||
#ifndef HUGE_VAL
|
||||
#define HUGE_VAL inf
|
||||
double inf = 0.0;
|
||||
|
||||
SET_HIGH_WORD(inf,0x7ff00000); /* set inf to infinite */
|
||||
#endif
|
||||
errno = ERANGE;
|
||||
return (float)HUGE_VAL;
|
||||
} else
|
||||
|
|
|
@ -55,12 +55,6 @@
|
|||
z = __ieee754_y0f(x);
|
||||
if(_LIB_VERSION == _IEEE_ || isnan(x) ) return z;
|
||||
if(x <= (float)0.0){
|
||||
#ifndef HUGE_VAL
|
||||
#define HUGE_VAL inf
|
||||
double inf = 0.0;
|
||||
|
||||
SET_HIGH_WORD(inf,0x7ff00000); /* set inf to infinite */
|
||||
#endif
|
||||
/* y0f(0) = -inf or y0f(x<0) = NaN */
|
||||
errno = EDOM;
|
||||
return (float)-HUGE_VAL;
|
||||
|
|
|
@ -58,12 +58,6 @@
|
|||
if(_LIB_VERSION == _IEEE_ || isnan(x) ) return z;
|
||||
if(x <= 0.0f){
|
||||
/* y1f(0) = -inf or y1f(x<0) = NaN */
|
||||
#ifndef HUGE_VAL
|
||||
#define HUGE_VAL inf
|
||||
double inf = 0.0;
|
||||
|
||||
SET_HIGH_WORD(inf,0x7ff00000); /* set inf to infinite */
|
||||
#endif
|
||||
errno = EDOM;
|
||||
return (float)-HUGE_VAL;
|
||||
}
|
||||
|
|
|
@ -54,12 +54,6 @@
|
|||
if(_LIB_VERSION == _IEEE_ || isnan(x) ) return z;
|
||||
if(x <= 0.0f){
|
||||
/* ynf(n,0) = -inf or ynf(x<0) = NaN */
|
||||
#ifndef HUGE_VAL
|
||||
#define HUGE_VAL inf
|
||||
double inf = 0.0;
|
||||
|
||||
SET_HIGH_WORD(inf,0x7ff00000); /* set inf to infinite */
|
||||
#endif
|
||||
errno = EDOM;
|
||||
return (float)-HUGE_VAL;
|
||||
}
|
||||
|
|
|
@ -32,12 +32,6 @@
|
|||
y = __ieee754_lgammaf_r(x,&(_REENT_SIGNGAM(_REENT)));
|
||||
if(_LIB_VERSION == _IEEE_) return y;
|
||||
if(!finitef(y)&&finitef(x)) {
|
||||
#ifndef HUGE_VAL
|
||||
#define HUGE_VAL inf
|
||||
double inf = 0.0;
|
||||
|
||||
SET_HIGH_WORD(inf,0x7ff00000); /* set inf to infinite */
|
||||
#endif
|
||||
if(floorf(x)==x&&x<=0.0f) {
|
||||
/* lgammaf(-integer) */
|
||||
errno = EDOM;
|
||||
|
|
|
@ -34,12 +34,6 @@
|
|||
float z;
|
||||
z = __ieee754_logf(x);
|
||||
if(_LIB_VERSION == _IEEE_ || isnan(x) || x > 0.0f) return z;
|
||||
#ifndef HUGE_VAL
|
||||
#define HUGE_VAL inf
|
||||
double inf = 0.0;
|
||||
|
||||
SET_HIGH_WORD(inf,0x7ff00000); /* set inf to infinite */
|
||||
#endif
|
||||
if(x==0.0f) {
|
||||
/* logf(0) */
|
||||
errno = ERANGE;
|
||||
|
|
|
@ -34,12 +34,6 @@
|
|||
z = __ieee754_log10f(x);
|
||||
if(_LIB_VERSION == _IEEE_ || isnan(x)) return z;
|
||||
if(x<=0.0f) {
|
||||
#ifndef HUGE_VAL
|
||||
#define HUGE_VAL inf
|
||||
double inf = 0.0;
|
||||
|
||||
SET_HIGH_WORD(inf,0x7ff00000); /* set inf to infinite */
|
||||
#endif
|
||||
if(x==0.0f) {
|
||||
/* log10f(0) */
|
||||
errno = ERANGE;
|
||||
|
|
|
@ -41,12 +41,6 @@
|
|||
return __ieee754_scalbf(x,fn);
|
||||
#else
|
||||
float z;
|
||||
#ifndef HUGE_VAL
|
||||
#define HUGE_VAL inf
|
||||
double inf = 0.0;
|
||||
|
||||
SET_HIGH_WORD(inf,0x7ff00000); /* set inf to infinite */
|
||||
#endif
|
||||
z = __ieee754_scalbf(x,fn);
|
||||
if(_LIB_VERSION == _IEEE_) return z;
|
||||
if(!(finitef(z)||isnan(z))&&finitef(x)) {
|
||||
|
|
|
@ -35,12 +35,6 @@
|
|||
if(_LIB_VERSION == _IEEE_) return z;
|
||||
if(!finitef(z)&&finitef(x)) {
|
||||
/* sinhf(finite) overflow */
|
||||
#ifndef HUGE_VAL
|
||||
#define HUGE_VAL inf
|
||||
double inf = 0.0;
|
||||
|
||||
SET_HIGH_WORD(inf,0x7ff00000); /* set inf to infinite */
|
||||
#endif
|
||||
errno = ERANGE;
|
||||
return ( (x>0.0f) ? HUGE_VAL : -HUGE_VAL);
|
||||
} else
|
||||
|
|
|
@ -34,12 +34,6 @@
|
|||
y = __ieee754_gamma_r(x,signgamp);
|
||||
if(_LIB_VERSION == _IEEE_) return y;
|
||||
if(!finite(y)&&finite(x)) {
|
||||
#ifndef HUGE_VAL
|
||||
#define HUGE_VAL inf
|
||||
double inf = 0.0;
|
||||
|
||||
SET_HIGH_WORD(inf,0x7ff00000); /* set inf to infinite */
|
||||
#endif
|
||||
if(floor(x)==x&&x<=0.0)
|
||||
/* gamma(-integer) or gamma(0) */
|
||||
errno = EDOM;
|
||||
|
|
|
@ -34,12 +34,6 @@
|
|||
y = __ieee754_lgamma_r(x,signgamp);
|
||||
if(_LIB_VERSION == _IEEE_) return y;
|
||||
if(!finite(y)&&finite(x)) {
|
||||
#ifndef HUGE_VAL
|
||||
#define HUGE_VAL inf
|
||||
double inf = 0.0;
|
||||
|
||||
SET_HIGH_WORD(inf,0x7ff00000); /* set inf to infinite */
|
||||
#endif
|
||||
if(floor(x)==x&&x<=0.0)
|
||||
/* lgamma(-integer) */
|
||||
errno = EDOM;
|
||||
|
|
|
@ -34,12 +34,6 @@
|
|||
y = __ieee754_gammaf_r(x,signgamp);
|
||||
if(_LIB_VERSION == _IEEE_) return y;
|
||||
if(!finitef(y)&&finitef(x)) {
|
||||
#ifndef HUGE_VAL
|
||||
#define HUGE_VAL inf
|
||||
double inf = 0.0;
|
||||
|
||||
SET_HIGH_WORD(inf,0x7ff00000); /* set inf to infinite */
|
||||
#endif
|
||||
if(floorf(x)==x&&x<=0.0f) {
|
||||
/* gammaf(-integer) or gamma(0) */
|
||||
errno = EDOM;
|
||||
|
|
|
@ -34,12 +34,6 @@
|
|||
y = __ieee754_lgammaf_r(x,signgamp);
|
||||
if(_LIB_VERSION == _IEEE_) return y;
|
||||
if(!finitef(y)&&finitef(x)) {
|
||||
#ifndef HUGE_VAL
|
||||
#define HUGE_VAL inf
|
||||
double inf = 0.0;
|
||||
|
||||
SET_HIGH_WORD(inf,0x7ff00000); /* set inf to infinite */
|
||||
#endif
|
||||
if(floorf(x)==x&&x<=0.0f) {
|
||||
/* lgammaf(-integer) or lgamma(0) */
|
||||
errno = EDOM;
|
||||
|
|
Loading…
Reference in New Issue