How do you set and check a single bit in a programming language that does not support bitwise operations?
I'm using a programming language (more a scripting language) that does not support any bitwise operators like AND, OR, XOR, NOT (and shift as well). Common arithmetic and logical operations like + - ...
2¹⁶-1 & 2⁵ = 2⁵ (or? obviously ?) A developer asked me today what is bitwise 65535 & 32 i.e. 2¹⁶-1 & 2⁵ = ? I thought at first spontaneously 32 but it seemed to easy whereupon I thought ...
Suppose you were given an integer number in decimal notation. This when represented in binary will be a series of 0's and 1's. This sequence varies in length with the magnitude of the number. Now ...