I\'m doing some trigonometry calculations in C/C++ and am running into problems with rounding errors. For example, on my Linux system:
#include
I get the exact same result on my system - I'd say it is close enough
I would solve the problem by changing the format string to "%f\n" :)
However, this gives you a "better" result, or at least on my system it does give -3.661369e-245
#include
#include
int main(int argc, char *argv[]) {
printf("%e\n", (long double)sin(M_PI));
return 0;
}