Qbasicnews.com

Full Version: XOR big numbers?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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
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
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.
*****
i know its a stupid question-
@anyone who knows the answer- what is XOR? :oops:
anku wt