Non-decimal radices/Output: Difference between revisions

Added Quackery.
m (syntax highlighting fixup automation)
(Added Quackery.)
Line 1,439:
#print oct(n), n, hex(n)
# output: 041 33 0x21</syntaxhighlight>
 
=={{header|Quackery}}==
 
<syntaxhighlight lang="Quackery"> ' [ 22 333 4444 55555 ] witheach
[ dup
say "Decimal " echo cr
dup
' [ 2 3 4 5 ] witheach
[ 2dup say " in base " echo
swap base put
say " -> " echo cr
base release ]
cr 2drop ]</syntaxhighlight>
 
{{out}}
 
<pre>Decimal 22
in base 2 -> 10110
in base 3 -> 211
in base 4 -> 112
in base 5 -> 42
 
Decimal 333
in base 2 -> 101001101
in base 3 -> 110100
in base 4 -> 11031
in base 5 -> 2313
 
Decimal 4444
in base 2 -> 1000101011100
in base 3 -> 20002121
in base 4 -> 1011130
in base 5 -> 120234
 
Decimal 55555
in base 2 -> 1101100100000011
in base 3 -> 2211012121
in base 4 -> 31210003
in base 5 -> 3234210
</pre>
 
=={{header|R}}==
1,462

edits