A double precision floating point number
 has about 15 significant digits and the magnitude can be between 1e-308 to 1e308.
Let's say that the distance from the base of your measurement to the surface is estimated to be about x units of length, and that the surface roughness, measurement error, and any other uncertainty is about a in the same units of length. (The choice of units is upto you.) Here it will be natural to suppose thatx is relatively larger than a.
At least the following restrictions need to be satisfied.
- The magnitude of the number xis smaller than about1e308.
- The magnitude of the number ais larger than about1e-308.
- The ratio a/xis larger than1e-15.
I think you could store the raw data of measurements about the distance from the moon to the earth (3e8 m) to resolve a hair (1e-5 m) in double precision floating point numbers in the units of meter.
If you are detecting a smooth surface on the moon from the earth at the resolution of one atomic layer, maybe 15 significant digits of a double precision floating point number will not be enough to faithfully represent the measurement results. However, if your measurement apparatus has more significant digits natively, you can store the average (or typical) distance d in one floating point number, and store the difference x-d of the measured distance from the average in other floating point numbers for the respective measurements.