summaryrefslogtreecommitdiffstats
path: root/lib/msun/src/s_truncl.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/msun/src/s_truncl.c')
-rw-r--r--lib/msun/src/s_truncl.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/msun/src/s_truncl.c b/lib/msun/src/s_truncl.c
index c475b90..cb5e6c9 100644
--- a/lib/msun/src/s_truncl.c
+++ b/lib/msun/src/s_truncl.c
@@ -36,7 +36,7 @@ static char rcsid[] = "$FreeBSD$";
#define MANH_SIZE LDBL_MANH_SIZE
#endif
-static const long double huge = 1.0e300;
+static const double huge = 1.0e300;
long double
truncl(long double x)
@@ -46,13 +46,13 @@ truncl(long double x)
if (e < MANH_SIZE - 1) {
if (e < 0) { /* raise inexact if x != 0 */
- if (huge + x > 0.0)
+ if (huge + (double)x > 0.0)
u.e = 0.0;
} else {
uint64_t m = ((1llu << MANH_SIZE) - 1) >> (e + 1);
if (((u.bits.manh & m) | u.bits.manl) == 0)
return (x); /* x is integral */
- if (huge + x > 0.0) { /* raise inexact flag */
+ if (huge + (double)x > 0.0) { /* raise inexact flag */
u.bits.manh &= ~m;
u.bits.manl = 0;
}
@@ -61,7 +61,7 @@ truncl(long double x)
uint64_t m = (uint64_t)-1 >> (64 - LDBL_MANT_DIG + e + 1);
if ((u.bits.manl & m) == 0)
return (x); /* x is integral */
- if (huge + x > 0.0) /* raise inexact flag */
+ if (huge + (double)x > 0.0) /* raise inexact flag */
u.bits.manl &= ~m;
}
return (u.e);
OpenPOWER on IntegriCloud