Non-decimal radices/Convert: Difference between revisions

add Scheme
(Perl: simplify and fix case of arg $n = 0)
(add Scheme)
Line 3,360:
 
def bigToBase(num: BigInt, newBase: Int): String = num.toString(newBase)</syntaxhighlight>
 
=={{header|Scheme}}==
R7RS specifies only a radix of 2, 8, 10, or 16 for the functions below. However, some implementations support arbitrary (e.g. Chibi-Scheme or Guile).
<syntaxhighlight lang="scheme">
(number->string 26 16)
 
(string->number "1a" 16)</syntaxhighlight>
 
=={{header|Seed7}}==
559

edits