summaryrefslogtreecommitdiffstats
path: root/lib/msun/src/s_ceill.c
diff options
context:
space:
mode:
authorstefanf <stefanf@FreeBSD.org>2005-04-22 09:57:55 +0000
committerstefanf <stefanf@FreeBSD.org>2005-04-22 09:57:55 +0000
commit13322eaf9bf51b3cb07a19237fea84cdd013e9e1 (patch)
treef73917ead846bd897f9a3fa7d6384ec9600355f1 /lib/msun/src/s_ceill.c
parent1268b440dc549568fa58865671762f02df1f70a4 (diff)
downloadFreeBSD-src-13322eaf9bf51b3cb07a19237fea84cdd013e9e1.zip
FreeBSD-src-13322eaf9bf51b3cb07a19237fea84cdd013e9e1.tar.gz
Use double additions to raise the inexact exception to work around problems
with long double addition on sparc64.
Diffstat (limited to 'lib/msun/src/s_ceill.c')
-rw-r--r--lib/msun/src/s_ceill.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/msun/src/s_ceill.c b/lib/msun/src/s_ceill.c
index 1de973b..6abbe10 100644
--- a/lib/msun/src/s_ceill.c
+++ b/lib/msun/src/s_ceill.c
@@ -50,7 +50,7 @@ static char rcsid[] = "$FreeBSD$";
} while (0)
#endif
-static const long double huge = 1.0e300;
+static const double huge = 1.0e300;
long double
ceill(long double x)
@@ -60,7 +60,7 @@ ceill(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)
if (u.bits.exp > 0 ||
(u.bits.manh | u.bits.manl) != 0)
u.e = u.bits.sign ? 0.0 : 1.0;
@@ -76,7 +76,7 @@ ceill(long double x)
#endif
INC_MANH(u, 1llu << (MANH_SIZE - e - 1));
}
- 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;
}
@@ -95,7 +95,7 @@ ceill(long double x)
INC_MANH(u, 1);
}
}
- 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