Population count: Difference between revisions

Content added Content deleted
m (→‎{{header|11l}}: popcount())
m (→‎{{header|11l}}: bits:popcount())
Line 39: Line 39:
{{trans|Python}}
{{trans|Python}}


<syntaxhighlight lang="11l">print((0.<30).map(i -> (Int64(3) ^ i).popcount()))
<syntaxhighlight lang="11l">print((0.<30).map(i -> bits:popcount(Int64(3) ^ i)))


[Int] evil, odious
[Int] evil, odious
V i = 0
V i = 0
L evil.len < 30 | odious.len < 30
L evil.len < 30 | odious.len < 30
V p = i.popcount()
V p = bits:popcount(i)
I (p % 2) != 0
I (p % 2) != 0
odious.append(i)
odious.append(i)