title: how to compute the true decimal value of the binary approximation stored for a float number
body: <p>I was looking into <a href="https://docs.python.org/3.6/tutorial/floatingpoint.html" rel="nofollow noreferrer">python doc</a>, it says</p>
  
  <p>if Python were to print the true decimal value of the binary approximation stored for 0.1, it would have to display</p>
  
  <pre><code>&gt;&gt;&gt; 0.1
  0.1000000000000000055511151231257827021181583404541015625
  </code></pre>
  
  <p>my question is, is there an existing API I can use to get the long string value?</p>
  
  <p>or I have to do this manully? like</p>
  
  <pre><code>target = 0.1
  tem = 0.0
  for i in range(-1, -307, -1):
      if (2 ** i &lt; target):
          if (tem + 2 ** i &lt; target):
              tem += 2 ** i
              print(i)
          else:
              break
  </code></pre>
  
  <p>this code block is just to demonstrate what I want to get.  </p>
  
  <p>I searched inside SO, found people just cite the doc without provide an implementation.</p>