I was wondering if bitmath (bitshift left, bitshift right, OR, XOR, AND, NOT) can be expressed using regular math
a= 01b= 11c = (a/2 * b/2)*2 + (a%2 * b%2); // c = b & a
Is a (01) and b (11) binary intergers, or decimal intergers?
I don't know what kind of number b (11)
for a 2 bitter
a= 01b= 11c = (a/2 * b/2)*2 + (a%2 * b%2);
So either robtillaart is wrong, or I am wrong.
(1/2 * 3/2)*2 + (1%2 * 3%2) = 2.5
Also, % (modulo) is not regular math.
What is regular math according to you?