This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug math/10135] New: Incorrect result for scalblnl(x, MINLONG)


scalblnl(x, MINLONG) returns copysign(inf,x) instead of copysign(0,x)

The following patch fixes the problem (k=k+n overflow):
--- s_scalblnl.c.orig   2009-05-07 16:46:54.000000000 -0700
+++ s_scalblnl.c        2009-05-07 16:47:23.000000000 -0700
@@ -56,10 +56,10 @@
            }
         if (k==0x7fff) return x+x;             /* NaN or Inf */
         k = k+n;
-        if (n> 50000 || k > 0x7ffe)
-         return huge*__copysignl(huge,x); /* overflow  */
        if (n< -50000)
          return tiny*__copysignl(tiny,x);
+        if (n> 50000 || k > 0x7ffe)
+         return huge*__copysignl(huge,x); /* overflow  */
         if (k > 0)                             /* normal result */
            {SET_LDOUBLE_EXP(x,(es&0x8000)|k); return x;}
         if (k <= -63)

-- 
           Summary: Incorrect result for scalblnl(x, MINLONG)
           Product: glibc
           Version: 2.9
            Status: NEW
          Severity: normal
          Priority: P2
         Component: math
        AssignedTo: aj at suse dot de
        ReportedBy: l_m at pacbell dot net
                CC: glibc-bugs at sources dot redhat dot com


http://sourceware.org/bugzilla/show_bug.cgi?id=10135

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]