I'm using gcc on Linux.
Whether I do this,
or this,Code:printf(" x=%5.4f<br>",145348224945.0000/3330389019.0000);
I get -0.0000 as the result. And I don't understand why.Code:printf(" x=%5.4f<br>",145348224945.0000L/3330389019.0000L);
In the actual program, I have variables, of course.
Is there any way to get around this error?Code:int a, d; long b, c; long double x; x=(long double) (a*b) / (long double) (c*d);