2 ms·
Why two variables? Can't you always encode two arbitrary-width integers into one arbitrary-width integer? For example, using 0b0001 as a split character, to en
by btdmaster 3y ago
Why two variables? Can't you always encode two arbitrary-width integers into one arbitrary-width integer?
For example, using 0b0001 as a split character, to end up with the pseudocode left, right = memory.split('0001') and then encoding everything else without using any 0b0001 pattern. It might be awfully complicated, but you can always use a fixed but arbitrarily large part of this arbitrary length integer as scratch space to implement this encoding.
Edit: for an easier time, put one integer in all the even-indexed parts of the binary number, and the other in all the odd-indexed parts of the number.