I have a problem with "sin" function of libc.
#include <cmath>
#include <stdio.h>
int main(int argc, char **argv)
{
double tt = 6.28318530717958620000; // 2 * M_PI
double yy = ::sin(tt);
printf("%.32f\n", yy);
return 0;
}
When compile the above code using "g++" without any optimization option, it would output "-0.00000000000000024492127076447545". But if with "-O3" option, it would output "-0.00000000000000024492935982947064".
Why doesn't it return "-0.00000000000000024492935982947064" without "-O3"? Thanks in advance.