for my $x (0..0xff) { my $y = ( $x & 0x80 ) ? -($x ^ 0xff) : $x; say "$x $y" } [download]
In reply to Re^2: Flipping partial bits by jszinger in thread Flipping partial bits by rickss