Help for this page

Select Code to Download


  1. or download this
    my @bits;
    for (128 64 32 16 8 4 2 1) {
        push @bits, ($dec & $_)  <=> 0;
    }
    
  2. or download this
    my $dec_a = $dec & 128;
    my $dec_b = $dec &  64;
    ...
    my $dec_f = $dec &   4;
    my $dec_g = $dec &   2;
    my $dec_h = $dec &   1;