This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Bug or feature?


Hi,
please give me a hint:
Is this a bug or a feature:
The pow funcion doesn't reset errno to 0, if all is o.k.
See the following prog:

gcc -v:
Reading specs from 
/sw/egcs/lib/gcc-lib/i686-pc-linux-gnulibc1/egcs-2.91.57/specs
gcc version egcs-2.91.57 19980901 (egcs-1.1 release)

cat h.c:
#include <errno.h>
#include <math.h>
#include <stdio.h>

int main(int argc,const char *argv[])
{
 double w;

 printf("errno=%d\n",errno);

 w=pow(-1.17,0.37);
 printf("errno=%d\n",errno);

 w=pow(1.17,0.37);
 printf("errno=%d\n",errno);

 errno=0;
 w=pow(1.17,0.37);
 printf("errno=%d\n",errno);

 return 0;
}


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]