Use bitwise operations for powers of two [#2282]