Logical & and |
Posted on 1999-01-07
Looking to do some arithmetic operation on a number to clear all the hex-bits of a number except the lower 4. For example:
The number '96237' is equal to the hex value '0001 77ed'. I want to just keep the lower 4 bits which in this case is '77ed'. Hex value '77ed' is 30701, the number I want. Sooo... How can I take the number '96237' (or any number) do some arithemetic to clear all the bits except the last 4, to end up with the value '96237';
$num = 96237;
HELP! Thanks so much!!