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/2678] pow returns incorrect results on underflow


------- Additional Comments From zimmerma+gcc at loria dot fr  2009-09-24 09:43 -------
This is still wrong with glibc 2.9, and with 2.10.1 (development version):

pow(-2.225074e-308,3.000000e+00) = 0.000000 (-0 expected) [mpfr -0.000000]
pow(-2.225074e-308,1.677722e+07) = 0.000000 (-0 expected) [mpfr -0.000000]
pow(-2.225074e-308,1.000000e+10) = 0.000000 (0 expected) [mpfr 0.000000]
pow(-2.225074e-308,1.000000e+20) = 0.000000 (0 expected) [mpfr 0.000000]
pow(-1.797693e+308,-3.000000e+00) = 0.000000 (-0 expected) [mpfr -0.000000]
pow(-1.797693e+308,-1.677722e+07) = 0.000000 (-0 expected) [mpfr -0.000000]
pow(-1.797693e+308,-1.000000e+10) = 0.000000 (0 expected) [mpfr 0.000000]
pow(-1.797693e+308,-1.000000e+20) = 0.000000 (0 expected) [mpfr 0.000000]

Moreover when compiling with -O1 with GCC 4.3.2 (i.e., when constant folding is
activated) all tests except the first one are wrong too (but the values computed
by MPFR are correct):

libc version: 2.10.1
pow(-2.225074e-308,3.000000e+00) = -0.000000 (-0 expected) [mpfr -0.000000]
pow(-2.225074e-308,1.677722e+07) = 0.000000 (-0 expected) [mpfr -0.000000]
pow(-2.225074e-308,1.000000e+10) = 0.000000 (0 expected) [mpfr 0.000000]
pow(-2.225074e-308,1.000000e+20) = 0.000000 (0 expected) [mpfr 0.000000]
pow(-1.797693e+308,-3.000000e+00) = 0.000000 (-0 expected) [mpfr -0.000000]
pow(-1.797693e+308,-1.677722e+07) = 0.000000 (-0 expected) [mpfr -0.000000]
pow(-1.797693e+308,-1.000000e+10) = 0.000000 (0 expected) [mpfr 0.000000]
pow(-1.797693e+308,-1.000000e+20) = 0.000000 (0 expected) [mpfr 0.000000]


-- 


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

------- 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]