|
Posted by sathyashrayan on July 16, 2008, 2:53 am
Please log in for more thread options
>>
>>>I was taking an online PHP test and got the question
>>>
>>> What will the output of the following statement be
>>>
>>> echo 4<<5;
>>>
>>> After the test, I searched google but couldn't find any such
>>> operator/construct.
>>> Can any one explain what '<<' does?
>>
>>search for "computer number system" in google, then search for base 2
>>numbers.Then come to bit operators.
>
> I find that to be odd advice. I'm very much in favor of "Google it" as a
> first-stage answer, but your search terms would imply that the << operator
> is a generic part of binary arithmetic. That's not true. The << operator
> was a C language invention, and in order to learn that "<<" is the "left
> shift operator", you have to stumble upon a reference for a programming
> language that implements it.
opps.. got it.. you are correct.. Boolean logic never talks about shifts.
Shifts are Register specific..
Correct me if i am wrong..
|