Help for this page

Select Code to Download


  1. or download this
      6 as 8-bit unsigned =   00000110 =   6 as 8-bit 2's comp
    226 as 8-bit unsigned =   11100010 = -30 as 8-bit 2's comp
                            + --------
    232 as 8-bit unsigned =   11101000 = -24 as 8-bit 2's comp
    
  2. or download this
    my $x = 0b11100010;  # 226
    
    ...
    $x = unpack('c', pack('C', $x));
    
    say $x;  # -30