Should bitw* function use round to coerce to integer rather than as.integer?
str((6.6-6)*10)
#num 6
bitwShiftL(1,(6.6-6)*10)
#[1] 32
bitwShiftL(1,6)
#[1] 64
This is due to the fact that Bitwise Logical Operations coerce to integer and as.integer does trunc. In our case (6.6-6)*10 is internally stored as 5.99999... which is ok (see Why are these numbers not equal?)
I would assume that someone writing bitwShiftL(1,5.9) is actually willing to shift by 6 rather than 5.