Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
stillwrong
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
2 ms
·
1.
▲
by
stillwrong
5y ago
The function doesn't do the comment says it does. The code to "Swap the bits." just turns the bits on. >>> def swap_bits(x): # Get the bit at position 6 and 17. bit6 = x & (1 << 6)