Advertisement

Bitshift in VB?

Started by January 15, 2001 10:40 AM
1 comment, last by TheSalmon 24 years ago
Much to my dismay, I''m being forced to read VB at computer class in my school so I was wondering if you can bitshift an integer in VB like you do in C with "<<" or ">>" (I''m guessing no, but I''d like to know for sure...) No game will ever rule more than CBT!
---Mikael Lax
I don''t think VB has bitshift operators, use multiplication and division instead (2 << 2 = 2 * 4, 2 >> 2 = 2 / 4).
I'm reminded of the day my daughter came in, looked over my shoulder at some Perl 4 code, and said, "What is that, swearing?" - Larry Wall
Advertisement
Most modern compilers automatically convert multiplication and division into their bit shifting counterparts, so you probably have no need to do explicit do so.

And considering VB is platform dependant you will most likely always use the same compiler, so you don''t have to worry certain compilers failing to do so.


- Houdini
- Houdini

This topic is closed to new replies.

Advertisement