Not sure what edition I have - just purchased it from Amazon 2/8/2019.
Unless I’m mistaken, the code on page 23 has an error. The code is supposed to return the number of bits in a number passed to the func count_bits, but it in fact returns the number of bits of value 1.
The fourth line should be:
num_bits += 1
num_bits += x & 1
Can someone pls confirm? Thx