Fast multiplication/division by 2 for floats and doubles (C/C++)
This is one of those highly-application specific things. It may help in some cases and not in others. (In the vast majority of cases, a straight-forward multiplication is still best.) The “intuitive” way of doing this is just to extract the bits into a 64-bit integer and add the shift value directly into the exponent. … Read more