|
-
Sep 12th, 2001, 10:40 PM
#1
exclusive OR of two integers
Is there any direct way to exclusive OR two integers in VB?
My method is to convert the integers to strings of their binary presentations, and then exclusive OR it character by character
It seems silly. Any fast and direct method of doing this? Thanks
-
Sep 12th, 2001, 11:45 PM
#2
Fanatic Member
You could use this:
VB Code:
Dim x As Integer, A As Integer, B As Integer
A = 10 '00001010
B = 24 '00011000
x = A Xor B '00010010
I'm baaaack...
VB5 Professional Edition, VC++ 6
Using a 1 gHz Thunderbird, 256 mb RAM, 40 gb HD system with Win98se
I feel special because I finally figured out how to loop midis: Post link
I'm a fanatic too 
-
Sep 13th, 2001, 12:09 AM
#3
-
Sep 14th, 2001, 12:04 AM
#4
AFAIK, the OR, XOR, etc. functions perform their operations a bitwise comparison between two numbers / bytes.
- Aurilus
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
|