summaryrefslogtreecommitdiff
path: root/libc/sysdeps/ieee754/ldbl-128ibm/s_nearbyintl.c
diff options
context:
space:
mode:
Diffstat (limited to 'libc/sysdeps/ieee754/ldbl-128ibm/s_nearbyintl.c')
-rw-r--r--libc/sysdeps/ieee754/ldbl-128ibm/s_nearbyintl.c62
1 files changed, 31 insertions, 31 deletions
diff --git a/libc/sysdeps/ieee754/ldbl-128ibm/s_nearbyintl.c b/libc/sysdeps/ieee754/ldbl-128ibm/s_nearbyintl.c
index bfcd11044..92ced5218 100644
--- a/libc/sysdeps/ieee754/ldbl-128ibm/s_nearbyintl.c
+++ b/libc/sysdeps/ieee754/ldbl-128ibm/s_nearbyintl.c
@@ -34,11 +34,11 @@ __nearbyintl (long double x)
fenv_t env;
static const long double TWO52 = 4503599627370496.0L;
union ibm_extended_long_double u;
- u.d = x;
+ u.ld = x;
- if (fabs (u.dd[0]) < TWO52)
+ if (fabs (u.d[0].d) < TWO52)
{
- double high = u.dd[0];
+ double high = u.d[0].d;
feholdexcept (&env);
if (high > 0.0)
{
@@ -52,13 +52,13 @@ __nearbyintl (long double x)
high += TWO52;
if (high == 0.0) high = -0.0;
}
- u.dd[0] = high;
- u.dd[1] = 0.0;
- math_force_eval (u.dd[0]);
- math_force_eval (u.dd[1]);
+ u.d[0].d = high;
+ u.d[1].d = 0.0;
+ math_force_eval (u.d[0]);
+ math_force_eval (u.d[1]);
fesetenv (&env);
}
- else if (fabs (u.dd[1]) < TWO52 && u.dd[1] != 0.0)
+ else if (fabs (u.d[1].d) < TWO52 && u.d[1].d != 0.0)
{
double high, low, tau;
/* In this case we have to round the low double and handle any
@@ -67,57 +67,57 @@ __nearbyintl (long double x)
may already be rounded and the low double may have the
opposite sign to compensate. */
feholdexcept (&env);
- if (u.dd[0] > 0.0)
+ if (u.d[0].d > 0.0)
{
- if (u.dd[1] > 0.0)
+ if (u.d[1].d > 0.0)
{
/* If the high/low doubles are the same sign then simply
round the low double. */
- high = u.dd[0];
- low = u.dd[1];
+ high = u.d[0].d;
+ low = u.d[1].d;
}
- else if (u.dd[1] < 0.0)
+ else if (u.d[1].d < 0.0)
{
/* Else the high double is pre rounded and we need to
adjust for that. */
- tau = __nextafter (u.dd[0], 0.0);
- tau = (u.dd[0] - tau) * 2.0;
- high = u.dd[0] - tau;
- low = u.dd[1] + tau;
+ tau = __nextafter (u.d[0].d, 0.0);
+ tau = (u.d[0].d - tau) * 2.0;
+ high = u.d[0].d - tau;
+ low = u.d[1].d + tau;
}
low += TWO52;
low -= TWO52;
}
- else if (u.dd[0] < 0.0)
+ else if (u.d[0].d < 0.0)
{
- if (u.dd[1] < 0.0)
+ if (u.d[1].d < 0.0)
{
/* If the high/low doubles are the same sign then simply
round the low double. */
- high = u.dd[0];
- low = u.dd[1];
+ high = u.d[0].d;
+ low = u.d[1].d;
}
- else if (u.dd[1] > 0.0)
+ else if (u.d[1].d > 0.0)
{
/* Else the high double is pre rounded and we need to
adjust for that. */
- tau = __nextafter (u.dd[0], 0.0);
- tau = (u.dd[0] - tau) * 2.0;
- high = u.dd[0] - tau;
- low = u.dd[1] + tau;
+ tau = __nextafter (u.d[0].d, 0.0);
+ tau = (u.d[0].d - tau) * 2.0;
+ high = u.d[0].d - tau;
+ low = u.d[1].d + tau;
}
low = TWO52 - low;
low = -(low - TWO52);
}
- u.dd[0] = high + low;
- u.dd[1] = high - u.dd[0] + low;
- math_force_eval (u.dd[0]);
- math_force_eval (u.dd[1]);
+ u.d[0].d = high + low;
+ u.d[1].d = high - u.d[0].d + low;
+ math_force_eval (u.d[0]);
+ math_force_eval (u.d[1]);
fesetenv (&env);
}
- return u.d;
+ return u.ld;
}
long_double_symbol (libm, __nearbyintl, nearbyintl);