Re: Math & Decimal Accuracy
For the sake of security and originality, I can't post the actual code. But, I obviously know exactly how it works.
Overrides just accept whatever figure the member provides, which is in tenths for mileage and ones for distance.
When it's tank by tank, the input is usually tenths and ones again unless they use the gallons>mileage converter. In that case, there's insignificant rounding (7 places?) and the mileage figure is stored as an extended decimal. The tank averages are weighted based on distance [(d1*m1)+(d2*m2)+(d3*m3)]/(m1+m2+m3) and the final car's mileage is stored with the same long decimal.
|