提到位时 `pop` 的含义

Meaning of `pop` when referring to bits

查看 GCC's builtins,我注意到在函数名称 (__builtin_popcount) 等中使用了字符串 pop。我还看到了其他引用以弹出其他实现。

当提到设置位时,为什么使用 pop,它是什么意思?

"population"的简写(即"populated"设为1的位数),又称为汉明权重.

来自Wikipedia

The Hamming weight of a string is the number of symbols that are different from the zero-symbol of the alphabet used. It is thus equivalent to the Hamming distance from the all-zero string of the same length. For the most typical case, a string of bits, this is the number of 1's in the string. In this binary case, it is also called the population count, popcount or sideways sum. It is the digit sum of the binary representation of a given number and the ℓ₁ norm of a bit vector.