title: convert single precision floating point to half precision floating point
body: <p>I am struggling to convert 32bit floating point to 16bit floating point with C.</p>
  
  <p>I understand the concept of normalizing, denormalizing, etc.</p>
  
  <p>But I failed to understand the below result.</p>
  
  <p>This conversion complies with IEEE 754 standard. (using round-to-even mode)</p>
  
  <pre><code>32bit floating point
  00110011 01000000 00000000 00000000 
  
  converted 16bit floating point
  00000000 00000001
  </code></pre>
  
  <p>This is the step what I've taken.</p>
  
  <p>Given 32bit floating point's sign bit is 0, exp field is 102, rest is fraction bits field.</p>
  
  <p>So exp field 102 has to be -127 bias, so it becomes -25, and it goes like below.</p>
  
  <pre><code>// since exp field is not zero, there will be leading 1.
  1.1000000 00000000 00000000 * 2^(-25)
  </code></pre>
  
  <p>When converting above number to half precision floating point, we have to plus bias (15) to the exponent to encode exp field.</p>
  
  <p>so exp field is -10.</p>
  
  <p>Since encoded exp field is smaller than 0, given 32bit floating point cannot be expressed successfully to the half precision floating point.</p>
  
  <p>So I thought half precision floating point bit pattern will go like below</p>
  
  <pre><code>00000000 00000000
  </code></pre>
  
  <p>But Why <code>00000000 00000001</code>?</p>
  
  <p>I have read many articles that have been uploaded on stackoverflow, but they are just the code samples, not actually dealing with the internal behavior.</p>
  
  <p>Can someone please contradict my misconception?</p>