Results 1 to 4 of 4

Thread: [vb2010] Operator >> ?

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    May 2009
    Posts
    459

    [vb2010] Operator >> ?

    What is the function of the operator >>?

    Executing a code like this (some code found online):

    Code:
     Return (((value) >> 16) And 15)
    I obtain always zero as result, whatever value.

    If I write for test:
    Debug.Print((((50373888) >> 16) And 15).ToString)
    Debug.Print((((50373889) >> 16) And 15).ToString)
    Debug.Print((((50373894) >> 16) And 15).ToString)

    I obtain always zero. I can't find online tutorials about this operator so I don't understand why.

    Ty

  2. #2
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    Re: [vb2010] Operator >> ?


  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    May 2009
    Posts
    459

    Re: [vb2010] Operator >> ?

    I have seen, ty.

    So, if I well understand:

    Code:
            Debug.Print((((50373889) >> 16)).ToString) ================> 768
            Debug.Print((((50373889) >> 16) And 15).ToString)==========> 0

    110000000010100101000000010 (binary of 50373889)

    1100000000 (===> shift 16 = 768)
    0000001111 (AND 15)
    0000000000 Result is 0

    Results are right... evidently are the numbers generated from the code that are wrong.

  4. #4
    Powered By Medtronic dbasnett's Avatar
    Join Date
    Dec 2007
    Location
    Jefferson City, MO
    Posts
    9,754

    Re: [vb2010] Operator >> ?

    The Windows calculator has view for Programmer. >> is Rsh and And is And.

    So the steps in the calculator are:

    type 50373889
    click Rsh
    type 16
    click And
    type 15
    press enter
    My First Computer -- Documentation Link (RT?M) -- Using the Debugger -- Prime Number Sieve
    Counting Bits -- Subnet Calculator -- UI Guidelines -- >> SerialPort Answer <<

    "Those who use Application.DoEvents have no idea what it does and those who know what it does never use it." John Wein

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