Non-decimal radices/Input: Difference between revisions

Line 613:
=={{header|PARI/GP}}==
Binary conversion is built in to PARI/GP, this script can convert from bases2-36 to bases 2-36. I've had help with this script at http:\\mersenneforums.org . The main flaw in this script I see is that it doesn't allow 36^x-1 type strings, I'll have to add that on later.
<lang parigp>convert(numb1,b1,b2)={
<lang PARI/GP>
convert(numb1,b1,b2)={
my(B=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"],a=0,c="");
numb1=Vec(Str(numb1));
Line 629 ⟶ 628:
);
c
};</lang>
 
</lang>
Note that version 2.8.0+ supports hexadecimal (0x1ff) and binary (0b10101) inputs. Further, it can accept generic input as a vector:
{{works with|PARI/GP|2.8.0+}}
<lang parigp>fromdigits([1,15,15],16)</lang>
 
=={{header|Perl}}==