Thumpalumpacus
Major
Down to 13 decimal places you are getting into the realm of moles and groups of molecules and certainly into the realm of standard temperature and pressure Boyles law etc. As per your post, if you take the filler cap off on a hot day your tank of fuel is changing all the time the cap is off, measured to 13 decimal places, and same if you take off in a plane, that is before any discussion of what happens in the carburettor. The problem with the gallon was it came before these issues, there are liquid and dry gallons in the US system. Gallon - Wikipedia
That's exactly why I added the caveat that I wasn't arguing with your point that drilling down to thirteen decimal places is silly.
My understanding is that a gallon is a liquid measure of weight, not volume. Water, for instance, doesn't really expand or contract until it hits a phase-change, but volatiles like petrochemicals can and do change liquid volume IAW ambient temperature, so a gallon of gas takes up marginally more volume on a hot day compared to a cold day.
Again: not significant when you get down to 13 decimal places.
Solids aren't sold by the gallon in America, so I don't know what a gallon of wood might look like.