• Advertisement

Archived

This topic is now archived and is closed to further replies.

what does (3>>4) do?

This topic is 5514 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

i had never seen anything like this when programmming for the PC. But now that i have started programming on the dreamcast and playstation2 it comes up alot. It seems that maybe it converts numbers to hex or something like that. Can someone give me the exact definition of what the >> symbol between numbers does? Thanks

Share this post


Link to post
Share on other sites
Advertisement
>> is the right bitwise shift operator. It takes the number to the left of it and shifts each bit in the binary representation of said number over the number on the right of it times (ie, x >> y shifts x right y times). Shifting right in the binary system is equivalent to dividing by two, just as shifting right in decimal is equivalent to dividing by ten, so it''s a quick way to do binary division and exponentiation (shift left).

Share this post


Link to post
Share on other sites

  • Advertisement