X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=src%2Fmath%2Fexpl.c;h=0a7f44f685ee3b708962dc9683698ffcd8074775;hb=7396ef0a05b834bf92c4f268a3336c0bc10c3593;hp=50a04297c22826ded4f022abd5282691bdeedae1;hpb=19b1a8453e9d329a16711900a84797c5f1333208;p=musl diff --git a/src/math/expl.c b/src/math/expl.c index 50a04297..0a7f44f6 100644 --- a/src/math/expl.c +++ b/src/math/expl.c @@ -100,7 +100,7 @@ long double expl(long double x) if (x > 11356.5234062941439488L) /* x > ln(2^16384 - 0.5) */ return x * 0x1p16383L; if (x < -11399.4985314888605581L) /* x < ln(2^-16446) */ - return 0x1p-10000L * 0x1p-10000L; + return -0x1p-16445L/x; /* Express e**x = e**f 2**k * = e**(f + k ln(2)) @@ -119,4 +119,10 @@ long double expl(long double x) x = 1.0 + 2.0 * x; return scalbnl(x, k); } +#elif LDBL_MANT_DIG == 113 && LDBL_MAX_EXP == 16384 +// TODO: broken implementation to make things compile +long double expl(long double x) +{ + return exp(x); +} #endif