This is the mail archive of the
glibc-bugs@sources.redhat.com
mailing list for the glibc project.
[Bug math/564] New: "pow(1.0, nan)" should return nan
- From: "shiba at mail2 dot accsnet dot ne dot jp" <sourceware-bugzilla at sources dot redhat dot com>
- To: glibc-bugs at sources dot redhat dot com
- Date: 20 Nov 2004 15:30:51 -0000
- Subject: [Bug math/564] New: "pow(1.0, nan)" should return nan
- Reply-to: sourceware-bugzilla at sources dot redhat dot com
"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.