I am trying to create a physical calculation program in Java. So I used some formulas, but they always returned the wrong value. I split them up and found: (I have used long
so far.)
8 * 830584000 = -1945262592
which is obviously wrong. The formulas contain fractions and very high numbers, for example 6.095E23 and 4.218E-10.
So, what type of data is best for getting the right result?
source
share