my $neg = -1; my $negBin = sprintf ("010.10b", $neg); print $negBin; #returns a lot of 1s instead of 11_1111_1111. (without underscores) #### my $num = 1024; my $bin = sprintf ("010.10b", $num); print $bin; #returns 100_0000_0000 instead of 00_0000_0000