How do I convert between float and vec4,vec3,vec2?
<p>This question is very related to the question here(<a href="https://stackoverflow.com/questions/7059962/how-do-i-convert-a-vec4-rgba-value-to-a-float">How do I convert a vec4 rgba value to a float?</a>).</p>

<p>There is some of articles or questions related to this question already, but I wonder most of articles are not identifying which type of floating value.
As long as I can come up with, there is some of floating value packing/unpacking formula below.</p>

<ul>
<li>unsigned normalized float</li>
<li>signed normalized float</li>
<li>signed ranged float (the floating value I can find range limitation)</li>
<li>unsigned ranged float</li>
<li>unsigned float</li>
<li>signed float</li>
</ul>

<p>However, these are just 2 case actually. The other packing/unpacking can be processed by these 2 method.</p>

<ul>
<li>unsigned ranged float (I can pack/unpack by easy bitshifting)</li>
<li>signed float</li>
</ul>

<p>I want to pack and unpack signed floating values into vec3 or vec2 also. </p>

<p>For my case, the floating value is not ensured to be normalized, so I can not use the simple bitshifting way.</p>