get first n bits of integer | ScratchStats