Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re^3: bit array comparison

by Athanasius (Archbishop)
on Oct 23, 2019 at 03:05 UTC ( #11107872=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my $i_cnt = () = sprintf("%b", $i) =~ /1/g;
    my $u_cnt = () = sprintf("%b", $u) =~ /1/g;
    
  2. or download this
    my $i_cnt = sprintf('%b', $i) =~ tr/1//;
    my $u_cnt = sprintf('%b', $u) =~ tr/1//;
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (4)
As of 2021-04-12 04:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?