You cannot leave shift float
variables because (a) your FPU will not have a switch barrel at all that is open to you, so it is physically impossible to create code for this, and (b) what would it mean? The basic representation of bits consists of several fields with different values, do you really want these bits to merge with each other?
If you want to multiply the number held in this variable by two, you should just do it.
If you want to reinterpret the float as some type that a left shift makes sense (for example, a suitable large unsigned integer type) for some horrible bit hacking, such as the square root of Carmack, well, you can do it too, but on modern hardware it's unlikely that you really need to: seriously think if there is a better way to do what you want.
source share