This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug math/2678] pow returns incorrect results on underflow
- From: "zimmerma+gcc at loria dot fr" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sources dot redhat dot com
- Date: 24 Sep 2009 09:43:39 -0000
- Subject: [Bug math/2678] pow returns incorrect results on underflow
- References: <20060521003011.2678.jsm28@gcc.gnu.org>
- Reply-to: sourceware-bugzilla at sourceware dot org
------- 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.