Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3240756
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T18:07:17+00:00 2026-05-17T18:07:17+00:00

Okay, I tried looking up what >> , or shift means, but it’s way

  • 0

Okay, I tried looking up what >>, or shift means, but it’s way over my head as this site explains it: http://www.janeg.ca/scjp/oper/shift.html

What would the explanation be, if talking to a kid?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T18:07:18+00:00Added an answer on May 17, 2026 at 6:07 pm

    Computers are binary devices. Because of this, numbers are represented by a sequence of 1s and 0s.

    Bitshifting is simply moving those sequences of 1s and 0s left or right.

    So all the >> operator does is shift the bits towards the right one bit.

    Consider the number 101:

    // Assuming signed 8-bit integers
    01100101 // How 101 is represented in binary
    00110010 // After right shifting one bit, this represents 50
    

    The least significant bit in this case was truncated. Obviously the devil’s in the details, but that’s all there is really to it.

    The << operator does the opposite operation:

    // Assuming signed 8-bit integers
    01100101 // How 101 is represented in binary
    11001010 // After left shifting one bit, this represents -54
    
    // Assuming unsigned 8-bit integers
    01100101 // How 101 is represented in binary
    11001010 // After left shifting one bit, this represents 202
    

    In this case, the most significant bit was truncated since I used only 8-bits. If the number had more bits, however:

    // Assuming signed 16-bit integers
    00000000 01100101 // How 101 is represented in binary
    00000000 11001010 // After left shifting one bit, this represents 202
    00000001 10010100 // After left shifting one bit again, this represents 404
    

    So you may get different numbers depending on how many bits and the data types associated with those bits you’re dealing with.

    Addendum: If you’re wondering how binary works, think about how the decimal number system works. Consider the number 5287. It can be written like this:

    5287
    

    But you can also write it out like this:

    5287 = (5 * 1000) + (2 * 100) + (8 * 10) + (7 * 1)
    

    Which you can then write out like this:

    5287 = (5 * 10^3) + (2 * 10^2) + (8 * 10^1) + (7 * 10^0)
    

    The above equation explains why the decimal number system is sometimes called the base-10 system. The decimal number system employs the use of 10 digits (0-9). Notice how the exponents correspond to digit position.

    The binary number system, or the base-2 system, is the exact same thing but with the number two as the base of the exponents, and employing only two digits: 0 and 1.

    5287 = 00010100 10100111 (base 2)
         = (0 * 2^15) + (0 * 2^14) + (0 * 2^13) + (1 * 2^12)
         + (0 * 2^11) + (1 * 2^10) + (0 * 2^9)  + (0 * 2^8)
         + (1 * 2^7)  + (0 * 2^6)  + (1 * 2^5)  + (0 * 2^4)
         + (0 * 2^3)  + (1 * 2^2)  + (1 * 2^1)  + (1 * 2^0)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Okay, this thing is driving me insane, I have tried every way, I have
Okay I tried asking this question yesterday but i'm not sure if I gave
okay....i'm sending some variables over forms...i tried with borh session and cookie, i'm getting
Okay, this is starting to drive me a little bit nuts. I've tried several
Okay, so this seems simple, but I can't think of a straightforward solution; Basically
Okay, I tried everything but I can't find answer. My data reader skips empty
Okay, so this is not the first time I've had this problem, but it
I have been looking all over the Internet for an answer to this question
Okay I've tried multiple things and looked for answers to this and I can't
Okay, I've tried using Google-sensei and searching around on this website, and while I've

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.