title: using struct pack and unpack on floating point number 0.01 output 0.009999999776482582.
body: <p>using 'struct pack and unpack' on floating point number 0.01 outputs 0.009999999776482582. 
  For my project I would have to configure values which are float
  and the same needs to be stored in binary file and I would need this data to analyze later and I need the exact values that was configured. </p>
  
  <p>Can some one help me if there is any way that I could store the exact value 0.01 and retrieve the same.</p>
  
  <p>Based on some of the post I have already tried using double instead of float and it works but the problem with using double is my file size increases. I have a lot of parameters which is float and can take values any where between 0 to 5. 
  Hence any other suggestion would be appreciated. </p>
  
  <p>Here is the sample code</p>
  
  <pre><code>import struct
  a = 0.01
  b = struct.pack('&lt;f', a)
  c = struct.unpack('&lt;f', b)
  print c
  (0.009999999776482582,)
  </code></pre>