title: FP16 max number
body: <p>When I was looking the following code, I was not able to understand, where does the 127, 16 and 23 come from? I know the bit representation of 127, 16, and the shift operation, but couldn't put them together. </p>
  
  <pre><code>const FP32 f16max = { (127 + 16) &lt;&lt; 23 };
  </code></pre>
  
  <p>This comes from line 358 of <a href="https://eigen.tuxfamily.org/dox/Half_8h_source.html" rel="nofollow noreferrer">https://eigen.tuxfamily.org/dox/Half_8h_source.html</a></p>
  
  <p>I know this means 1.0: </p>
  
  <pre><code>0011 1111 1000 0000 0000 0000 0000 000
  </code></pre>
  
  <p>The 127 must be the <code>011 1111 1</code>, left shift 23 is to remove all the mantissa. what does this 16 do here?  </p>