Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

bit array comparison

by Amendil (Novice)
on Oct 22, 2019 at 12:27 UTC ( [id://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
Domain Nodelet?
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?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (3)
As of 2024-04-26 04:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found