Questions tagged [bitwise-and]

Anything related to the bitwise-AND operation, i.e. a binary operation carried out on two integer operands whose result is obtained performing the logical AND between each pair of corresponding bits in the operands.

Anything related to the bitwise-AND operation, i.e. a binary operation carried out on two integer operands whose result is obtained performing the logical AND between each pair of corresponding bits in the operands.

317 questions
-4
votes
2 answers

Bitwise Operators (And) in PHP. Getting weird answers

So I'm making this script that needs to get the integer from the & operator of two numers in PHP. So far I have managed it to work but with small numbers (<512). When I try to do do for example: echo 65535 $ 2048; I get a result of 0, when it's…
-5
votes
1 answer

MAXIMUM AND VALUE

Given a positive integer N , and a range of positive integers from L to R . Find the smallest positive integer in the range having Maximum Bitwise AND value with N. NOTE: N needn't to be necessarily lie in the range L to R.
1 2 3
21
22