Non-decimal radices/Output: Difference between revisions

Rename Perl 6 -> Raku, alphabetize, minor clean-up
m (→‎{{header|Phix}}: added sample output)
(Rename Perl 6 -> Raku, alphabetize, minor clean-up)
Line 160:
DllCall("msvcrt\_i64toa","Int64",DllCall("msvcrt\_strtoui64","Str",NumStr,"Uint",0,"UInt",InputBase,"CDECLInt64"),"Str",S,"UInt",OutputBase,"CDECL")
Return S
}</lang>
 
=={{header|AWK}}==
Line 547:
The 99 beers and 0x2D Scotches.
The 99 (0x63, 0143) beers and 0x2D (45, 055) Scotches.</pre>
 
=={{header|Go}}==
<lang go>package main
Line 1,138 ⟶ 1,139:
<lang perl>foreach my $n (0..33) {
printf " %6b %3o %2d %2X\n", $n, $n, $n, $n;
}</lang>
 
=={{header|Perl 6}}==
 
Calling the <code>.base</code> method on a number returns a string. It can handle all bases between 2 and 36:
 
<lang perl6>say 30.base(2); # "11110"
say 30.base(8); # "36"
say 30.base(10); # "30"
say 30.base(16); # "1E"
say 30.base(30); # "10"</lang>
 
Alternatively, <code>printf</code> can be used for some common number bases:
<lang perl6>for 0..33 -> $n {
printf " %6b %3o %2d %2X\n", $n xx 4;
}</lang>
 
Line 1,329 ⟶ 1,315:
;; "n4" "j4" "f4" "b4" "74" "34" "u3" "r3" "o3" "l3" "i3" "f3")
</lang>
 
=={{header|Perl 6Raku}}==
(formerly Perl 6)
 
Calling the <code>.base</code> method on a number returns a string. It can handle all bases between 2 and 36:
 
<lang perl6>say 30.base(2); # "11110"
say 30.base(8); # "36"
say 30.base(10); # "30"
say 30.base(16); # "1E"
say 30.base(30); # "10"</lang>
 
Alternatively, <code>printf</code> can be used for some common number bases:
<lang perl6>for 0..33 -> $n {
printf " %6b %3o %2d %2X\n", $n xx 4;
}</lang>
 
=={{header|REXX}}==
Line 1,564 ⟶ 1,566:
) print(f"${i.toString(radix)}%6s$eol")
}</lang>
 
=={{header|Scheme}}==
<lang scheme>(do ((i 0 (+ i 1)))
10,327

edits