Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

bit array comparison

by Amendil (Novice)
on Oct 22, 2019 at 12:27 UTC ( #11107846=perlquestion: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    use common::sense;
    
    ...
    printf "union is %#032b  %d\n", $u, $u;
    say "set bit count in intersection: $i_cnt";
    say "set bit count in union: $u_cnt";
    
  2. or download this
    a is 0b000000000000000000000000000011  3
    b is 0b000000000000000000000000000110  6
    ...
    union is 0b000000000000000000000000000111  7
    set bit count in intersection: 3
    set bit count in union: 5
    
  3. or download this
    a is 0b000000000000000000000000000011  3
    b is 0b000000000000000000000000000110  6
    ...
    union is 0b000000000000000000000000000111  7
    set bit count in intersection: 1
    set bit count in union: 3
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://11107846]
Approved by Corion
Front-paged by haukex
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (5)
As of 2021-04-13 23:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?