public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug math/3866] New: pow(double, double) does not fulfil several of C99's requirements
@ 2007-01-12 23:31 kreckel at ginac dot de
  2008-07-30 10:20 ` [Bug math/3866] " mtk dot manpages at gmail dot com
                   ` (6 more replies)
  0 siblings, 7 replies; 13+ messages in thread
From: kreckel at ginac dot de @ 2007-01-12 23:31 UTC (permalink / raw)
  To: glibc-bugs

Here is a list of bugs in GlibCs pow implementation.


1) pow(-1, 1e100):

Returns NaN and raises the "invalid" floating-point exception.

It should return 1 and raise no exception. (This is because all large
floating-point numbers are even integers if the radix is even. This
motivates pow(-1, inf) = +1, which is treated correctly by GlibC).


2) pow(-1, -1e100):

Same as above.


3) pow(-3.141592, 1e100):

Returns NaN and raises the "invalid" floating-point exception.

It should return +inf and raise the "overflow" floating-point exception flag.


4) pow(-3.141592, -1e100):

Returns NaN and raises the "invalid" floating-point exception.

It should return +0 and raise the "underflow" floating-point exception flag.



4) pow(-0, -1e100):

Raises the "invalid" floating point exception.

It shouldn't do that: this is just a case of exact division by
zero. Division by zero is correctly flagged and +inf is returned, but
the "invalid" flag is wrong.



5) pow(-inf, -1e100):

Raises the "invalid" floating point exception.

It shouldn't do that. After all, it correctly returns 0.


6) pow(-inf, 1e100):

Raises the "invalid" floating point exception.

It shouldn't do that. After all, it correctly returns +inf.


7) pow(-0, -9.0071991544401990e+15)

This returns +inf.

It should return -inf, since the double precision exponent is an odd number
(fabs(fmod(-9.0071991544401990e+15,2.0))==1.0 exactly).

-- 
           Summary: pow(double, double) does not fulfil several of C99's
                    requirements
           Product: glibc
           Version: 2.4
            Status: NEW
          Severity: normal
          Priority: P2
         Component: math
        AssignedTo: aj at suse dot de
        ReportedBy: kreckel at ginac dot de
                CC: glibc-bugs at sources dot redhat dot com
  GCC host triplet: i386-linux-gnu


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

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


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2021-08-25 16:36 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-3866-131@http.sourceware.org/bugzilla/>
2012-02-28 17:02 ` [Bug math/3866] pow(double, double) does not fulfil several of C99's requirements jsm28 at gcc dot gnu.org
2012-03-21 12:22 ` jsm28 at gcc dot gnu.org
2012-03-28 16:02 ` jsm28 at gcc dot gnu.org
2014-02-16 18:27 ` jackie.rosen at hushmail dot com
2014-05-28 19:46 ` schwab at sourceware dot org
2021-08-25 16:36 ` ovilewade9 at gmail dot com
2007-01-12 23:31 [Bug math/3866] New: " kreckel at ginac dot de
2008-07-30 10:20 ` [Bug math/3866] " mtk dot manpages at gmail dot com
2008-08-05 14:07 ` mtk dot manpages at gmail dot com
2008-08-05 14:20 ` mtk dot manpages at gmail dot com
2008-08-05 14:22 ` mtk dot manpages at gmail dot com
2008-08-05 22:06 ` kreckel at ginac dot de
2008-08-08  5:49 ` mtk dot manpages at gmail dot com
2009-09-24  8:14 ` vincent+libc at vinc17 dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).