Results 1 to 5 of 5

Thread: Bit-Shifting

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Oct 2000
    Location
    Leicestershire; ENGLAND
    Posts
    71

    Post

    Does anybody have any routines for emulating a left-shift on a number as per the C "<<" operator.

    I think I have successfully replicated the right-shift but do not seem to be abe to get the left shift working properly.

  2. #2
    Fanatic Member
    Join Date
    Feb 2000
    Location
    The Netherlands
    Posts
    715
    Do you mean bit-shifting for numbers (x/2) or strings(rotl and rotr in asm?)?
    Oetje
    [email protected]
    93606776
    Visual Basic 6, Windows 2000

    Never pet a burning dog

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Oct 2000
    Location
    Leicestershire; ENGLAND
    Posts
    71
    Numbers
    ie: SHL/SHR

  4. #4
    Fanatic Member
    Join Date
    Feb 2000
    Location
    The Netherlands
    Posts
    715
    Can't you do something like this?
    Code:
    Dim Number As Double
    
    Number = 1000
    
    'bit shift?
    Number = Number / 2
    Oetje
    [email protected]
    93606776
    Visual Basic 6, Windows 2000

    Never pet a burning dog

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Oct 2000
    Location
    Leicestershire; ENGLAND
    Posts
    71
    This does not always replicate the functions correctly and therefore does not alays return the correct value.

Posting Permissions

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



Click Here to Expand Forum to Full Width