long double log2l(long double x)
{
- long double z;
- long double y;
+ long double y, z;
int e;
if (isnan(x))
return x;
if (x <= 0.0) {
if (x == 0.0)
- return -1/(x+0); /* -inf with divbyzero */
+ return -1/(x*x); /* -inf with divbyzero */
return 0/0.0f; /* nan with invalid */
}
z += e;
return z;
}
+#elif LDBL_MANT_DIG == 113 && LDBL_MAX_EXP == 16384
+// TODO: broken implementation to make things compile
+long double log2l(long double x)
+{
+ return log2(x);
+}
#endif