Untitled

Pasted by zyp on Tue Jul 4 20:44:57 2023 UTC as Python
1
2
3
4
5
6
7
def bits_set(n):
	i = 0
	while n:
		if n & 1:
			yield i
		i += 1
		n >>= 1