title: Implementation of long double in c++
body: <p>Recently I was doing some research about types in c++ and I have couple questions about <code>long double</code>. For instance I have some number <code>long double x = -48.12e4</code>, then how accurate should I translate 0.12 to hex or bin (I prefer to use hex , easer to read). In the scheme of implementation I have 1 extra bit and I have no idea about its role -</p>
  
  <pre><code>//scheme 
  1bit    15bit   1bit   63bit 
  sign    e        1       m
  </code></pre>
  
  <p>For example lets take number that I have written before.</p>
  
  <pre><code>1)translate decimal to hex 
  -48.12 = -3.1E (are 2 digits after decimal enough?)
  
  2)normalization 
  0011.0001 1110  * 10^0 =  001.1 0001 1110 * 10^1
  
  3)calculation of "e"
  16 383 + 4 + 1 = 16 388 = 4004(hex) = 0100 0000 0000 0100
  
  4)collecting everything together
  1    0100 0000 0000 0100   1    1000 1111 0000 0..0
  sign|        e           |bit|      mantisa 
  What is that 1 bit for?
  5)reverse order
  0..000  0011 1100 0110  0000 0010  1010 0000 
  </code></pre>
  
  <p>Have I done everything right?</p>