Physics and thermodynamics texts (in the first chapter) overdo the minor-to-engineering fact that gravity varies with altitude.

Gravity and Altitude Before investing time in regard to the variation of gravity with altitude consider that but for space activities, virtually every engineering system operates at an altitude less than 30 kilometers ( ~ 16 miles). These numbers approximate the homosphere or zone of uniformly mixed atmosphere. The altitude of the peak of Mount Everest is 8.85 kilometers ( ~ 5.5 miles). There's not much engineering going on event that high. So what error would one incur by assuming a constant, surface value of | g(r) | for all altitudes up to 30 kilometers?

Gravity in its "inverse-square" form and approximated as the surface value are written below respactively.

The percent error of approximation incurred by using a constant (surface value) for the acceleration of gravity reduces algebraically to:

We see the error increases with altitude. With the Earth radius at 6367 km, for all altitudes up to 30 kilometers the error of the approximation is equal or less than: