Welcome to the VirtuQ Forums.
Results 1 to 2 of 2
  1. #1

    Question from pg no 49 in the book on bitwise operators

    Hi,

    In the book while explaining getbits function in Bitwise operators, it was assumed that bit position starts from 0 due to which (p+1-n) is used in the expression x >> (p+1-n) & ~(~0 << n); which can be taken as (p-n) normally with out any confusion.

    Could there be any specific reason why position count starts from 0.

    Thanks
    Saketh

  2. #2
    VirtuQ™ Moderator
    Join Date
    Jul 2011
    Location
    Bangalore, India
    Posts
    1,044
    Blog Entries
    2
    Hi Saketh,

    In 'C' indices always start from '0'. If you can give a bit more context, I may be able to provide more insight.

    Anup


 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •