BitShift operator on float

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

Thanks, Nicolò

Is it because of flaoting point vs fixed

Yup, basically. This isn’t specific to Julia; see: c - Left shift Float type - Stack Overflow

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

1 Like