I am studying about bitwise logical operations (AND, OR, etc.). For example.
15 AND 24 can be calculated as follow.
- convert given numbers into binary form.
01111 AND 11000
- Perform bitwise AND operation on each bit from both the numbers.
= 01000
- convert binary to decimal form.
8
I want to know,
Is there a direct way (without convert into the binary form) to get the result of this operation? If not please do tell what is the optimal way available to get the result. I need to do this for very large numbers up to 170141183460469231731687303715884105728 or beyond this.
I am trying to implement it in C, I can't store an integer greater than 18446744073709551615 in C, So I was wondering how operations on large numbers are achieved given that we can't store these numbers directly.
Is there any algorithm that takes chunks of these numbers and performs these operations. For example
0170 1411 8346 0469 2317 3168 7303 7158 8410 5728
&
1321 3221 3654 5646 5646 6546 6489 9873 9765 9721
-------------------------------------------------
result = very large number
Is there any online resource that I can use to get more understanding on this?