public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug math/564] New: "pow(1.0, nan)" should return nan
@ 2004-11-20 15:30 shiba@mail2.accsnet.ne.jp
2004-11-20 16:13 ` [Bug math/564] " schwab@suse.de
0 siblings, 1 reply; 2+ messages in thread
From: shiba@mail2.accsnet.ne.jp @ 2004-11-20 15:30 UTC (permalink / raw)
To: glibc-bugs
"pow(1.0, nan)" returns "1.0", but should return "nan".
Because current behavior contradicts a specification written in
sysdeps/ieee754/ldbl-128/e_powl.c. It says "Special cases: ... 3. (anything)
** NAN is NAN." The speification is appropriate, I believe.
This bug can be reproduced compiling with -lm and running following code:
#include <stdio.h>
#include <math.h>
main(){ double nan = 0.0 / 0.0; printf("%f\n", pow(1.0, nan)); }
It prints "1.000000", but should print "nan".
It occurs on Redhat9 (glibc-2.3.2-27.9.7, `uname -a`=Linux dhcppc0 2.4.20-31.9
#1 Tue Apr 13 18:04:23 EDT 2004 i686 i686 i386 GNU/Linux), and latest Debian
sarge (libc6 2.3.2.ds1-18, `uname -a`=Linux canna12 2.4.27-speakup #1 Thu Aug 19
21:46:14 CEST 2004 i686 GNU/Linux).
I've not tried latest CVS version of glibc, but I entered bug here because I
couldn't find any modification about pow() as far as I could, viewing codes
using cvsweb.
Note that this may (or may not) be IA-32 specific bug.
--
Summary: "pow(1.0, nan)" should return nan
Product: glibc
Version: 2.3.2
Status: NEW
Severity: normal
Priority: P2
Component: math
AssignedTo: aj at suse dot de
ReportedBy: shiba at mail2 dot accsnet dot ne dot jp
CC: glibc-bugs at sources dot redhat dot com
GCC host triplet: i686-pc-linux-gnu
http://sources.redhat.com/bugzilla/show_bug.cgi?id=564
------- 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] 2+ messages in thread
* [Bug math/564] "pow(1.0, nan)" should return nan
2004-11-20 15:30 [Bug math/564] New: "pow(1.0, nan)" should return nan shiba@mail2.accsnet.ne.jp
@ 2004-11-20 16:13 ` schwab@suse.de
0 siblings, 0 replies; 2+ messages in thread
From: schwab@suse.de @ 2004-11-20 16:13 UTC (permalink / raw)
To: glibc-bugs
------- Additional Comments From schwab at suse dot de 2004-11-20 16:13 -------
That specification is wrong. ISO C99 says in F.9.4.4 (The pow functions):
- pow(+1, y) returns 1 for any y, even a NaN.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |INVALID
http://sources.redhat.com/bugzilla/show_bug.cgi?id=564
------- 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] 2+ messages in thread
end of thread, other threads:[~2004-11-20 16:13 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-11-20 15:30 [Bug math/564] New: "pow(1.0, nan)" should return nan shiba@mail2.accsnet.ne.jp
2004-11-20 16:13 ` [Bug math/564] " schwab@suse.de
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).