-
Notifications
You must be signed in to change notification settings - Fork 0
HammingWeight
Stephen Crowley edited this page Feb 6, 2024
·
1 revision
Given an integer N
, define:
-
Shift Right:
$\text{ShiftRight}(N) = \text{floor}\left(\frac{N}{2}\right)$
-
Is Odd:
$\text{IsOdd}(N) = N - 2 \times \text{ShiftRight}(N)$