aboutsummaryrefslogtreecommitdiff
path: root/newlib
diff options
context:
space:
mode:
authorJozef Lawrynowicz <jozef.l@mittosystems.com>2019-01-22 10:39:38 +0000
committerCorinna Vinschen <corinna@vinschen.de>2019-01-23 10:46:30 +0100
commitd451d9ec78854766fe4b95795de7bdfa099f8524 (patch)
treee2a5fc697811ebfcc980fccc6d7b3d3822d7ae5a /newlib
parent7db203304ef12ac1b351b4890b0a4d5f61ad2c0c (diff)
downloadnewlib-d451d9ec78854766fe4b95795de7bdfa099f8524.zip
newlib-d451d9ec78854766fe4b95795de7bdfa099f8524.tar.gz
newlib-d451d9ec78854766fe4b95795de7bdfa099f8524.tar.bz2
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.
Diffstat (limited to 'newlib')
-rw-r--r--newlib/libm/math/wf_cosh.c2
-rw-r--r--newlib/libm/math/wf_exp.c2
-rw-r--r--newlib/libm/math/wf_gamma.c2
-rw-r--r--newlib/libm/math/wf_hypot.c2
-rw-r--r--newlib/libm/math/wf_j0.c2
-rw-r--r--newlib/libm/math/wf_j1.c2
-rw-r--r--newlib/libm/math/wf_jn.c2
-rw-r--r--newlib/libm/math/wf_lgamma.c2
-rw-r--r--newlib/libm/math/wf_log.c2
-rw-r--r--newlib/libm/math/wf_log10.c2
-rw-r--r--newlib/libm/math/wf_pow.c6
-rw-r--r--newlib/libm/math/wf_scalb.c2
-rw-r--r--newlib/libm/math/wf_sinh.c2
-rw-r--r--newlib/libm/math/wr_gamma.c2
-rw-r--r--newlib/libm/math/wrf_gamma.c2
-rw-r--r--newlib/libm/math/wrf_lgamma.c2
16 files changed, 18 insertions, 18 deletions
diff --git a/newlib/libm/math/wf_cosh.c b/newlib/libm/math/wf_cosh.c
index e0fd1c4..9760099 100644
--- a/newlib/libm/math/wf_cosh.c
+++ b/newlib/libm/math/wf_cosh.c
@@ -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
diff --git a/newlib/libm/math/wf_exp.c b/newlib/libm/math/wf_exp.c
index 73177bc..38cacd9 100644
--- a/newlib/libm/math/wf_exp.c
+++ b/newlib/libm/math/wf_exp.c
@@ -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;
diff --git a/newlib/libm/math/wf_gamma.c b/newlib/libm/math/wf_gamma.c
index 86517f1..0235ff4 100644
--- a/newlib/libm/math/wf_gamma.c
+++ b/newlib/libm/math/wf_gamma.c
@@ -39,7 +39,7 @@
/* gammaf(finite) overflow */
errno = ERANGE;
}
- return (float)HUGE_VAL;
+ return HUGE_VALF;
} else
return y;
#endif
diff --git a/newlib/libm/math/wf_hypot.c b/newlib/libm/math/wf_hypot.c
index 5bcce9c..dfc1e1d 100644
--- a/newlib/libm/math/wf_hypot.c
+++ b/newlib/libm/math/wf_hypot.c
@@ -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
diff --git a/newlib/libm/math/wf_j0.c b/newlib/libm/math/wf_j0.c
index 32e76fb..4d125db 100644
--- a/newlib/libm/math/wf_j0.c
+++ b/newlib/libm/math/wf_j0.c
@@ -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) */
diff --git a/newlib/libm/math/wf_j1.c b/newlib/libm/math/wf_j1.c
index 41d6c49..e178273 100644
--- a/newlib/libm/math/wf_j1.c
+++ b/newlib/libm/math/wf_j1.c
@@ -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) */
diff --git a/newlib/libm/math/wf_jn.c b/newlib/libm/math/wf_jn.c
index 450c815..3e4632e 100644
--- a/newlib/libm/math/wf_jn.c
+++ b/newlib/libm/math/wf_jn.c
@@ -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) */
diff --git a/newlib/libm/math/wf_lgamma.c b/newlib/libm/math/wf_lgamma.c
index 1ecd264..c644072 100644
--- a/newlib/libm/math/wf_lgamma.c
+++ b/newlib/libm/math/wf_lgamma.c
@@ -39,7 +39,7 @@
/* lgammaf(finite) overflow */
errno = ERANGE;
}
- return (float)HUGE_VAL;
+ return HUGE_VALF;
} else
return y;
#endif
diff --git a/newlib/libm/math/wf_log.c b/newlib/libm/math/wf_log.c
index 2f6ac77..93d1d21 100644
--- a/newlib/libm/math/wf_log.c
+++ b/newlib/libm/math/wf_log.c
@@ -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;
diff --git a/newlib/libm/math/wf_log10.c b/newlib/libm/math/wf_log10.c
index a61120d..c9f8ecb 100644
--- a/newlib/libm/math/wf_log10.c
+++ b/newlib/libm/math/wf_log10.c
@@ -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;
diff --git a/newlib/libm/math/wf_pow.c b/newlib/libm/math/wf_pow.c
index 2288977..73648b8 100644
--- a/newlib/libm/math/wf_pow.c
+++ b/newlib/libm/math/wf_pow.c
@@ -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;
}
}
}
diff --git a/newlib/libm/math/wf_scalb.c b/newlib/libm/math/wf_scalb.c
index b57e2e6..e87dc37 100644
--- a/newlib/libm/math/wf_scalb.c
+++ b/newlib/libm/math/wf_scalb.c
@@ -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 */
diff --git a/newlib/libm/math/wf_sinh.c b/newlib/libm/math/wf_sinh.c
index 9149d19..2f2c605 100644
--- a/newlib/libm/math/wf_sinh.c
+++ b/newlib/libm/math/wf_sinh.c
@@ -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
diff --git a/newlib/libm/math/wr_gamma.c b/newlib/libm/math/wr_gamma.c
index 9dda12b..c4c2a82 100644
--- a/newlib/libm/math/wr_gamma.c
+++ b/newlib/libm/math/wr_gamma.c
@@ -40,7 +40,7 @@
else
/* gamma(finite) overflow */
errno = ERANGE;
- return HUGE_VAL;
+ return HUGE_VALF;
} else
return y;
#endif
diff --git a/newlib/libm/math/wrf_gamma.c b/newlib/libm/math/wrf_gamma.c
index b03919b..d43c7f0 100644
--- a/newlib/libm/math/wrf_gamma.c
+++ b/newlib/libm/math/wrf_gamma.c
@@ -41,7 +41,7 @@
/* gammaf(finite) overflow */
errno = ERANGE;
}
- return (float)HUGE_VAL;
+ return HUGE_VALF;
} else
return y;
#endif
diff --git a/newlib/libm/math/wrf_lgamma.c b/newlib/libm/math/wrf_lgamma.c
index f12c0df..2785b87 100644
--- a/newlib/libm/math/wrf_lgamma.c
+++ b/newlib/libm/math/wrf_lgamma.c
@@ -41,7 +41,7 @@
/* lgammaf(finite) overflow */
errno = ERANGE;
}
- return (float)HUGE_VAL;
+ return HUGE_VALF;
} else
return y;
#endif