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