Page MenuHomeFreeBSD

D28870.diff
No OneTemporary

D28870.diff

Index: lib/msun/ld128/s_logl.c
===================================================================
--- lib/msun/ld128/s_logl.c
+++ lib/msun/ld128/s_logl.c
@@ -78,8 +78,8 @@
#ifdef DEBUG
#include <assert.h>
-#include <fenv.h>
#endif
+#include <fenv.h>
#include "fpmath.h"
#include "math.h"
@@ -469,9 +469,12 @@
if (hx == 0 || hx >= 0x8000) { /* zero, negative or subnormal? */
if (((hx & 0x7fff) | lx | llx) == 0)
RETURN1(rp, -1 / zero); /* log(+-0) = -Inf */
- if (hx != 0)
+ if (hx != 0) {
/* log(neg or NaN) = qNaN: */
- RETURN1(rp, (x - x) / zero);
+ if (!isnan(x))
+ feraiseexcept(FE_INVALID);
+ RETURN1(rp, __builtin_nanl(""));
+ }
x *= 0x1.0p113; /* subnormal; scale up x */
EXTRACT_LDBL128_WORDS(hx, lx, llx, x);
k = -16383 - 113;
@@ -581,7 +584,9 @@
if (ax == 0x3fff && (lx | llx) == 0)
RETURNP(-1 / zero); /* log1p(-1) = -Inf */
/* log1p(x < 1, or x NaN) = qNaN: */
- RETURNP((x - x) / (x - x));
+ if (!isnan(x))
+ feraiseexcept(FE_INVALID);
+ RETURNP(__builtin_nanl(""));
}
if (ax <= 0x3f8d) { /* |x| < 2**-113 */
if ((int)x == 0)

File Metadata

Mime Type
text/plain
Expires
Thu, Nov 14, 12:55 PM (8 m, 20 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14629512
Default Alt Text
D28870.diff (1 KB)

Event Timeline