i want to generate a pseudo-random bool stream based on a modulo operation on another stream of integers (say X), so the operation would be
return ( X % 2);
The only problem is that X is a stream of integers that always ends in 1, so for instance would be somehing like 1211, 1221, 1231, 1241 …. is there a way for me to disregard the last bit (without using string manip) so the test doesnt always pass or always fail?
If you’d otherwise be happy to use the last bits, use the penultimate bits instead:
So say the next number from your stream is 23:
Shifting that right by one bit (
>> 1) gives 1. With 25, the answer would be 0: