aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/ieee754/ldbl-128ibm/s_nearbyintl.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/ieee754/ldbl-128ibm/s_nearbyintl.c')
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_nearbyintl.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_nearbyintl.c b/sysdeps/ieee754/ldbl-128ibm/s_nearbyintl.c
index 5f92a5f..99f4747 100644
--- a/sysdeps/ieee754/ldbl-128ibm/s_nearbyintl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/s_nearbyintl.c
@@ -36,7 +36,9 @@ __nearbyintl (long double x)
union ibm_extended_long_double u;
u.ld = x;
- if (fabs (u.d[0].d) < TWO52)
+ if (!isfinite (u.d[0].d))
+ return x;
+ else if (fabs (u.d[0].d) < TWO52)
{
double xh = u.d[0].d;
double high = u.d[0].d;