#include <stdio.h>
#include <math.h>
int main(void){
printf("%lf\n", pow(1.0, 2.0));
printf("%f\n", pow(1.0, 2.0));
return 0;
}
First printf()
gives output 0.000000
but second printf()
gives output 1.000000
. Why?
Using Codeblocks on Windows 7 64 bit.
Using gcc command to compile give me an .exe that outputs 1.000000 for both statements.
If I compile pressing F9 on Codeblocks, I get 0.000000 for the first statement and 1.000000 for the second.
Finally, if I remove #include <stdio.h>
from source code in Codeblocks, all give me 1.000000 (no warnings or errors).