>Number: 10844
>Category: c
>Synopsis: Wrong computation on nan initialized vectors.
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: wrong-code
>Submitter-Id: net
>Arrival-Date: Sun May 18 17:26:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator: Christian Szegedy
>Release: gcc (GCC) 3.2.2
>Organization:
>Environment:
gentoo Linux
>Description:
The following program outputs nan istead of 0:
#include <math.h>
int main()
{
int n = 10;
int i;
double *w= (double*)malloc(sizeof(double)*n);
double x;
for( i=0 ; i<n ; i++ ) { w[i] = nan(""); }
w[0] = .0;
w[0] += .0;
printf("%lg\n",w[0]);
return 0;
}
>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.