sub binround { my $out = 1; my $in = shift; while ($in) { $in >>= 1; $out += $out; } $out; }