aboutsummaryrefslogtreecommitdiff
path: root/challenge-002/alex-daniel/perl6/ch-2.p6
blob: ade157486bacedb66ed65ec404c0a6841f00c3c8 (plain)
1
2
3
4
5
6
7
8
9
#| From base 10 to base 35
sub postfix:<₃₅>(Real() $a) { $a.base:       35 }
#| From base 35 to base 10
sub postfix:<₁₀>( Str() $a) { $a.parse-base: 35 }

sayALEXDANIEL₁₀;
say 836407881643061₃₅;

# You can do non-ints too, but they won't roundtrip as you might expect