title: compress floating point numbers with specified range and precision
body: <p>In my application I'm going to use floating point values to store geographical coordinates (latitude and longitude).</p>
  
  <p>I know that the integer part of these values will be in range <code>[-90, 90]</code> and <code>[-180, 180]</code> respectively. Also I have requirement to enforce some fixed precision on these values (for now it is <code>0.00001</code> but can be changed later). </p>
  
  <p>After studying single precision floating point type (<code>float</code>) I can see that it is just a little bit small to contain my values. That's because <code>180 * 10^5</code> is greater than <code>2^24</code> (size of the significand of float) but less than <code>2^25</code>.</p>
  
  <p>So I have to use double. But the problem is that I'm going to store huge amounts of this values, so I don't want to waste bytes, storing unnecessary precision.</p>
  
  <p>So how can I perform some sort of compression when converting my double value (with fixed integer part range and specified precision X) to byte array in java? So for example if I use precision from my example (<code>0.00001</code>) I end up with 5 bytes for each value.
  I'm looking for a lightweight algorithm or solution so that it doesn't imply huge calculations.</p>