-
Sep 11th, 2015, 01:15 PM
#1
Thread Starter
Hyperactive Member
[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
-
Sep 11th, 2015, 01:19 PM
#2
Re: [vb2010] Operator >> ?
-
Sep 11th, 2015, 03:35 PM
#3
Thread Starter
Hyperactive Member
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.
-
Sep 11th, 2015, 05:26 PM
#4
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|