For any integer n and where k is power of 2,
n % k = n & (k-1)
I wasn't able to proof this statement, how could it be proofed?
Thanks in Advance!
What is proof for finding remainder(%) when n divide by k, if k is power of two.
For any integer n and where k is power of 2,
n % k = n & (k-1)
I wasn't able to proof this statement, how could it be proofed?
Thanks in Advance!
Rev. | Lang. | By | When | Δ | Comment | |
---|---|---|---|---|---|---|
en2 | Kaleab_Asfaw | 2020-07-27 13:49:49 | 235 | Tiny change: 'oofed with out taking' -> 'oofed without taking' | ||
en1 | Kaleab_Asfaw | 2020-07-27 13:37:18 | 250 | Initial revision (published) |