Anonymous user
Non-decimal radices/Convert: Difference between revisions
m
→{{header|Perl}}: Add libheader
m (now included as demo\rosetta\Convert_base.exw) |
m (→{{header|Perl}}: Add libheader) |
||
Line 2,315:
print "$num\n"; # prints "26"</lang>
The [https://metacpan.org/pod/ntheory ntheory] module includes functions that will perform base conversion, and is fast. It supports bases up to 36 and bigints.{{libheader|ntheory}}
<lang perl>use ntheory qw/fromdigits todigitstring/;
my $n = 65261;
|