Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: How to do popcount (aka Hamming weight) in Perl

by LanX (Saint)
on Sep 24, 2017 at 12:58 UTC ( [id://1199993]=note: print w/replies, xml ) Need Help??


in reply to How to do popcount (aka Hamming weight) in Perl (popcount References)

> unpack('%32b*'

so Perl has already a specialized command for this! (cool)

but why do you need

> pack('Q'

then?

If it's some kind of normalization, why do you need to benchmark it too instead of keeping the data in that format?

Cheers Rolf
(addicted to the Perl Programming Language and ☆☆☆☆ :)
Je suis Charlie!

  • Comment on Re: How to do popcount (aka Hamming weight) in Perl

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1199993]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (3)
As of 2024-04-25 06:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found