BitShift operator on float


#1

Hi, I wonder why isn’t << (with >> and >>>) defined for float (32 and 64). Is it because of flaoting point vs fixed?

Thanks, Nicolò


#2

Is it because of flaoting point vs fixed

Yup, basically. This isn’t specific to Julia; see: https://stackoverflow.com/questions/9315539/left-shift-float-type


#3

Note also that you can use the exp2 function to multiply or divide a floating-point number by a power of 2.