Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
XOR big numbers?
#1
Check out this code:

Code:
a# = &HFFFFFFFFFF
a# = a# XOR &H385FFEDCA3

This gives me an overflow error. Is there a way to do calculations like this? I am using Microsoft Quickbasic Extended 7.1
Fade to nothing... your weakness disgusts me..."
Reply
#2
The bitwise operators only work with integer data-types, although QB hides this from you by doing some behind-the-scenes conversions. However, if your floating pt number is too big to be converted to an integer, QB will choke on the behind the scene conversion. (At least I think that's what's going on :???: )

Cheers
Reply
#3
Why do you have such huge numbers and then decide to do an XOR with them? It doesn't make sense.

Since XOR only affects individual bit positions, that is, there's no carry or overflow, then you could chop your numbers into 8 or 16 bit chunks and then do the XOR one chunk at a time. Since QB has no shift command, you can chop the numbers by dividing by powers of 2.
*****
Reply
#4
i know its a stupid question-
@anyone who knows the answer- what is XOR? :oops:
Reply
#5
right here

http://qbasicnews.com/qboho/qckxor.shtml
[Image: sig.php]
Back by popular demand!
I will byte and nibble you bit by bit until nothing remains but crumbs.
Reply
#6
anku wt
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)