Why does this equation produce two different values for e
in C (32-bit) and Java (64-bit)? They are off by an unexpectedly large amount.
int a, b, c, d;
double e;
a = -12806;
b = 1;
c = 800;
d = 19209;
double f = (32768 / 10.24);
e = (a + (double) b / c * d) / f;
C produces -3.9940624237060547. Java produces -3.9943714843750002.
UPDATE:
Sorry folks, this error appears to be something else than I expected. I reduced my code to just this equation and the numbers it produces are much closer.