[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [sc-users] small questions on bitwise and asBinaryDigits



hi again,
so is this essentially what you're trying to do?

5.asBinaryDigits(16).sum

On 26 Dec 2006, at 16:59, karlos wrote:

Next, I was trying to find a way to get the number of one's in the binary sequence of an integer by comparing them bitwise, but I am struggling to that. Maybe someone could explain how? This is the code I have been tinkering about with:



tom tlalim

....................
www.tomtlalim.tk
radio.sampleandhold.org
www.myspace.com/intowhite
www.club-mtk.tk
www.tangiercluj.tk
....................