You may be able to get rather better speed with some simplistic string manipulation. Consider:
sub mul2 { my($str, $add) = @_; (my $carry = $str) =~ tr/0-9/0000011111/; (my $str2 = "0$str") =~ tr/0-9/0246802468/; my $result = $str2 | "$carry$add"; $result =~ s/^0//; $result; }
Hugo
In reply to Re: bin2dec for big numbers
by hv
in thread bin2dec for big numbers
by spurperl
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |