Im extracting numeric data from a data base. I add all these data up and store it in an integer called totalPlan. Then I store this integer value in a float called planTotal. When i do that, sometimes i find that the int and float differ in the last digit.
if int totalPlan = 59879301 and i store this in float variable planTotal, then it stores planTotal as 5.98793E7 which when i display gets translated to 59879300.00.
Is there anyway I can avoid this loss of precision ? also, what causes this loss ? thanks in advance.