summaryrefslogtreecommitdiff
path: root/libc/sysdeps/ieee754/ldbl-128/s_logbl.c
diff options
context:
space:
mode:
Diffstat (limited to 'libc/sysdeps/ieee754/ldbl-128/s_logbl.c')
-rw-r--r--libc/sysdeps/ieee754/ldbl-128/s_logbl.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/libc/sysdeps/ieee754/ldbl-128/s_logbl.c b/libc/sysdeps/ieee754/ldbl-128/s_logbl.c
index cf6003e05..3ba67b7bd 100644
--- a/libc/sysdeps/ieee754/ldbl-128/s_logbl.c
+++ b/libc/sysdeps/ieee754/ldbl-128/s_logbl.c
@@ -41,10 +41,12 @@ __logbl (long double x)
{
/* POSIX specifies that denormal number is treated as
though it were normalized. */
- int m1 = (hx == 0) ? 0 : __builtin_clzll (hx);
- int m2 = (lx == 0) ? 0 : __builtin_clzll (lx);
- int ma = (m1 == 0) ? m2 + 64 : m1;
- return -16382.0 + (long double)(15 - ma);
+ int ma;
+ if (hx == 0)
+ ma = __builtin_clzll (lx) + 64;
+ else
+ ma = __builtin_clzll (hx);
+ ex -= ma - 16;
}
return (long double) (ex - 16383);
}