LonePalmBJ said:
FWIW, I tried converting 409MPG to Kilometers per Gallon, Kilometers per Liter or Liters per 100 KM just to see if it made more sense in metric. Nope.
409 MPG is 658.221 KM per Gallon, 173.88 KM per Liter, or 0.58 Liters per 100KM. Do these numbers trigger any special limits to anyone?
Well, we know (from the traffic-data thread) that the frequency value is stored as a signed 32-bit integer, representing 1/100ths of a MHz. So we could look for a power of two that is an upper limit that, divided by some power of ten (for fractional MPG), comes to 409. The first obvious one is an unsigned 12-bit field, which can range from 0 to 4095. But 409.5 mpg "ought to" round to 410, and there's no obvious reason to use a 12-bit field at all.
An unsigned 32 bit number can go to 4 294 967 295, and even if you divide that by 10^7 you get 429.4967295 which is well over 409.
The obvious answer at this point is that there is something else entirely going on. In any case computing average MPG by summation of "average so far" with "instantaneous average" is going to introduce all kinds of error, so if you sit back and think about it, you just decide this whole path is barking up the wrong tree.
The way to compute average fuel consumption—in MPG, or km/L, or L/km, or whatever—is to keep a running total of both "distance traveled" and "fuel consumed", and do the division dynamically. There's no obvious reason this should max out at 409 either unless the internal units are kind of screwy (e.g., distance in "ticks" where there's some weird conversion factor from ticks to both miles and km, and/or fuel in "driblets" with again some conversion factor).