Thread: arithmatic vs logical shift operation

  1. #1
    Registered User
    Join Date
    Mar 2007
    Posts
    25

    arithmatic vs logical shift operation

    Hi

    Whenever we do the shift operation (left or right) how can we know
    that the shift operation is an arithmetic or logical shift operation?

    Can someone tell me about any url where I can get examples on bit operations


    thanks & regards
    Onebrother

  2. #2
    Woof, woof! zacs7's Avatar
    Join Date
    Mar 2007
    Location
    Australia
    Posts
    3,459
    > Can someone tell me about any url where I can get examples on bit operations
    http://www.cprogramming.com/tutorial...operators.html -- On this very site.

  3. #3
    Hurry Slowly vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,788
    And here is http://en.wikipedia.org/wiki/Logical_shift wiki with special note about C

    as a conclusion - do not use bitshifting on signed numbers to avoid undefined behaviours
    All problems in computer science can be solved by another level of indirection,
    except for the problem of too many layers of indirection.
    – David J. Wheeler

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 5
    Last Post: 12-04-2008, 08:15 PM
  2. still problems with ceasar shift
    By trevordunstan in forum C Programming
    Replies: 2
    Last Post: 09-14-2008, 01:49 AM
  3. Replies: 16
    Last Post: 11-23-2007, 01:48 PM
  4. logical operation functions in c; And, Or, Xor, Not etc..
    By Jasonx521 in forum C Programming
    Replies: 6
    Last Post: 10-03-2006, 12:24 AM
  5. Logical Operation Sequence ?!?
    By Halo in forum C Programming
    Replies: 2
    Last Post: 04-16-2002, 12:49 PM