summaryrefslogtreecommitdiffstatshomepage
path: root/lib/libm/math.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libm/math.c')
-rw-r--r--lib/libm/math.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libm/math.c b/lib/libm/math.c
index 2c52edd1be..3dfd925655 100644
--- a/lib/libm/math.c
+++ b/lib/libm/math.c
@@ -442,7 +442,7 @@ float expf(float x)
/* argument reduction */
if (hx > 0x3eb17218) { /* if |x| > 0.5 ln2 */
if (hx > 0x3f851592) /* if |x| > 1.5 ln2 */
- k = invln2*x + half[sign];
+ k = (int)(invln2*x + half[sign]);
else
k = 1 - sign - sign;
hi = x - k*ln2hi; /* k*ln2hi is exact here */
@@ -533,7 +533,7 @@ float expm1f(float x)
k = -1;
}
} else {
- k = invln2*x + (sign ? -0.5f : 0.5f);
+ k = (int)(invln2*x + (sign ? -0.5f : 0.5f));
t = k;
hi = x - t*ln2_hi; /* t*ln2_hi is exact here */
lo = t*ln2_lo;