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//;