Use HUGE_VALF instead of HUGE_VAL in single-precision float libm math functions

This patch replaces instances of "(float).*HUGE_VAL" with a direct usage of
HUGE_VALF, which is also defined in math.h.
This commit is contained in:
Jozef Lawrynowicz 2019-01-22 10:39:38 +00:00 committed by Corinna Vinschen
parent 7db203304e
commit d451d9ec78
16 changed files with 18 additions and 18 deletions

View File

@ -36,7 +36,7 @@
if(fabsf(x)>8.9415985107e+01f) {
/* coshf(finite) overflow */
errno = ERANGE;
return (float)HUGE_VAL;
return HUGE_VALF;
} else
return z;
#endif

View File

@ -46,7 +46,7 @@ u_threshold= -1.0397208405e+02; /* 0xc2cff1b5 */
if(x>o_threshold) {
/* expf(finite) overflow */
errno = ERANGE;
return HUGE_VAL;
return HUGE_VALF;
} else if(x<u_threshold) {
/* expf(finite) underflow */
errno = ERANGE;

View File

@ -39,7 +39,7 @@
/* gammaf(finite) overflow */
errno = ERANGE;
}
return (float)HUGE_VAL;
return HUGE_VALF;
} else
return y;
#endif

View File

@ -36,7 +36,7 @@
if((!finitef(z))&&finitef(x)&&finitef(y)) {
/* hypotf(finite,finite) overflow */
errno = ERANGE;
return (float)HUGE_VAL;
return HUGE_VALF;
} else
return z;
#endif

View File

@ -57,7 +57,7 @@
if(x <= (float)0.0){
/* y0f(0) = -inf or y0f(x<0) = NaN */
errno = EDOM;
return (float)-HUGE_VAL;
return -HUGE_VALF;
}
if(x>(float)X_TLOSS) {
/* y0f(x>X_TLOSS) */

View File

@ -59,7 +59,7 @@
if(x <= 0.0f){
/* y1f(0) = -inf or y1f(x<0) = NaN */
errno = EDOM;
return (float)-HUGE_VAL;
return -HUGE_VALF;
}
if(x>(float)X_TLOSS) {
/* y1f(x>X_TLOSS) */

View File

@ -55,7 +55,7 @@
if(x <= 0.0f){
/* ynf(n,0) = -inf or ynf(x<0) = NaN */
errno = EDOM;
return (float)-HUGE_VAL;
return -HUGE_VALF;
}
if(x>(float)X_TLOSS) {
/* ynf(x>X_TLOSS) */

View File

@ -39,7 +39,7 @@
/* lgammaf(finite) overflow */
errno = ERANGE;
}
return (float)HUGE_VAL;
return HUGE_VALF;
} else
return y;
#endif

View File

@ -37,7 +37,7 @@
if(x==0.0f) {
/* logf(0) */
errno = ERANGE;
return (float)-HUGE_VAL;
return -HUGE_VALF;
} else {
/* logf(x<0) */
errno = EDOM;

View File

@ -37,7 +37,7 @@
if(x==0.0f) {
/* log10f(0) */
errno = ERANGE;
return (float)-HUGE_VAL;
return -HUGE_VALF;
} else {
/* log10f(x<0) */
errno = EDOM;

View File

@ -51,7 +51,7 @@
if(finitef(y)&&y<0.0f) {
/* 0**neg */
errno = EDOM;
return (float)-HUGE_VAL;
return -HUGE_VALF;
}
return z;
}
@ -67,8 +67,8 @@
/* powf(x,y) overflow */
errno = ERANGE;
if(x<0.0f&&rintf(y)!=y)
return (float)-HUGE_VAL;
return (float)HUGE_VAL;
return -HUGE_VALF;
return HUGE_VALF;
}
}
}

View File

@ -46,7 +46,7 @@
if(!(finitef(z)||isnan(z))&&finitef(x)) {
/* scalbf overflow; */
errno = ERANGE;
return (x > 0.0 ? HUGE_VAL : -HUGE_VAL);
return (x > 0.0 ? HUGE_VALF : -HUGE_VALF);
}
if(z==0.0f&&z!=x) {
/* scalbf underflow */

View File

@ -36,7 +36,7 @@
if(!finitef(z)&&finitef(x)) {
/* sinhf(finite) overflow */
errno = ERANGE;
return ( (x>0.0f) ? HUGE_VAL : -HUGE_VAL);
return ( (x>0.0f) ? HUGE_VALF : -HUGE_VALF);
} else
return z;
#endif

View File

@ -40,7 +40,7 @@
else
/* gamma(finite) overflow */
errno = ERANGE;
return HUGE_VAL;
return HUGE_VALF;
} else
return y;
#endif

View File

@ -41,7 +41,7 @@
/* gammaf(finite) overflow */
errno = ERANGE;
}
return (float)HUGE_VAL;
return HUGE_VALF;
} else
return y;
#endif

View File

@ -41,7 +41,7 @@
/* lgammaf(finite) overflow */
errno = ERANGE;
}
return (float)HUGE_VAL;
return HUGE_VALF;
} else
return y;
#endif