1. We have moved from vBulletin to XenForo and you are viewing the site in the middle of the move. Though the functional aspect of everything is working fine, we are still working on other changes including the new design on Xenforo.
    Dismiss Notice

sum = (sum >> 16) + (sum & 0xffff)

Discussion in 'C' started by en_7123, Mar 7, 2010.

  1. en_7123

    en_7123 New Member

    What does this statement mean in c
    sum = (sum >> 16) + (sum & 0xffff)
    Thanks
     
  2. techgeek.in

    techgeek.in New Member

    the above expression can be represented as:-

    sum=sum/(2^16) +sum


    becoz, (sum >> 16) means the sum divided by 2 to the power 16.. (refer to the meaning of bitwise left shift and bitwise right shidt)
    and
    (sum & 0xffff) itself gives sum.
     

Share This Page