As soon as I saw 'unsigned int'... You've got a perfectly valid altitude, it is just slightly negative. The double->int casts typically work as long as we don't have numbers larger or smaller than 2^31. Ofcourse casting the resulting signed integer to an unsigned int does work differently. Consider it FITNR.
_________________________
40GB - serial #40104051 gpsapp