473,386 Members | 1,823 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Bit Shift Operators

I've tried using the bit-shift operators (>> and <<) in
VB.Net, but the compiler objects. Does anybody know
why? Has anybody used them?

Thanks in advance
Jul 21 '05 #1
5 5096
Hi,
I've used them without any problems. What says the compiler when he objects
it?
Do you use the right datatypes?

"Simon" <an*******@discussions.microsoft.com> schrieb im Newsbeitrag
news:08****************************@phx.gbl...
I've tried using the bit-shift operators (>> and <<) in
VB.Net, but the compiler objects. Does anybody know
why? Has anybody used them?

Thanks in advance

Jul 21 '05 #2
There isn't one.
Just write you own (divide or multiply by 2)

"Simon" <an*******@discussions.microsoft.com> wrote in message
news:08****************************@phx.gbl...
I've tried using the bit-shift operators (>> and <<) in
VB.Net, but the compiler objects. Does anybody know
why? Has anybody used them?

Thanks in advance

Jul 21 '05 #3
Hi,

Thanks for replying.

The development environment underlines the >> in blue and
says "Expression expected". It is version 7 of the
development environment and Visual Basic.Net.

-----Original Message-----
Hi,
I've used them without any problems. What says the compiler when he objectsit?
Do you use the right datatypes?

"Simon" <an*******@discussions.microsoft.com> schrieb im Newsbeitragnews:08****************************@phx.gbl...
I've tried using the bit-shift operators (>> and <<) in
VB.Net, but the compiler objects. Does anybody know
why? Has anybody used them?

Thanks in advance

.

Jul 21 '05 #4
Are you using Visual Studio 2003 and the .net Framework version 1.1?

VS2002 and .net 1.0 don't support bit shifting in VB.net.

Hope this helps,

Trev.
"Simon" <an*******@discussions.microsoft.com> wrote in message
news:08****************************@phx.gbl...
I've tried using the bit-shift operators (>> and <<) in
VB.Net, but the compiler objects. Does anybody know
why? Has anybody used them?

Thanks in advance

Jul 21 '05 #5
On Fri, 5 Dec 2003 12:54:27 +0200, Ayende Rahien wrote:
There isn't one.


VB.Net 2003 supports the << and >> bit shifting operators. VB.Net 2002
does NOT support them.

--
Chris

To send me an E-mail, remove the underscores and lunchmeat from my E-Mail
address.
Jul 21 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
by: DeepaK K C | last post by:
main() { int a =100; a = a>>32; printf(" %d", a); } it prints "a" as 100 only....but I am expecting a = 0..... can some one tell me the reason?
2
by: joshc | last post by:
I have a question about the following: 4. The result of E1 << E2 is E1 left-shifted E2 bit positions: vacated bits are filled with zeros. ... If E1 has a signed type and a nonnegative value, and...
43
by: Mehta Shailendrakumar | last post by:
Hello, Can anyone suggest me operator to perform arithmetic shift in C? May it be for a perticular compiler. Thank you in advance. Regards, Shailendra
5
by: ritesh.noronha | last post by:
K&R states that the right operand must be non-negative. "The shift operators << and >> perform left and right shifts of their left operand by the number of bit positions given by the right...
3
by: Simon Johnson | last post by:
Is there an inbuilt circular shift operator in c#? I've googled it but because c# happens to be musical note.. i get a large noise to signal ratio :P Simon.
8
by: Chua Wen Ching | last post by:
Hi, I had some beginner questions. Do we need Shift << >> or Logical AND OR XOR operator in our daily programming? I am not sure why i need to use it? I had some samples of c# codes using it. ...
7
by: Marty McFly | last post by:
Hello VB Gurus, I have an unusual requirement to shift an unsigned int right one bit: Dim myVar As UInt32 = UInt32.Parse("123456") Dim myResult As UInt32 myResult = myVar >> 1 However, the...
9
by: deepak | last post by:
If i'm shifting an integer 'n' times where n > sizeof(int), It's giving the same value as that of n-sizeof(n). Why is it behaving like this. I studied that the bit 'll be replaced by '0'. ...
16
by: Santosh Nayak | last post by:
Hi, Is there any way to catch the losing bit occurring due to Right Shift Operator ? e.g int a = 5 ; a = a >1 ; // // a is now 2 and the least significant bit is lost // // I want this...
4
by: Felix Kater | last post by:
Hi, when I use something like int Shift= 3; long Value= 1 << Shift; What is the data type of the const value '1' here? In other terms: What is the possible maximum of 'Shift' here?
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.