Non-decimal radices/Convert: Difference between revisions

Perl: simplify and fix case of arg $n = 0
(Lua: fix case of n = 0)
(Perl: simplify and fix case of arg $n = 0)
Line 2,638:
my($n,$b) = @_;
my $s = "";
while ($n)do {
$s .= ('0'..'9','a'..'z')[$n % $b]; . $s
} while $n = int($n / $b);
}$s
scalar(reverse($s));
}
sub base_from {
559

edits