Non-decimal radices/Convert: Difference between revisions
Content added Content deleted
(→{{header|Forth}}: fix comments) |
(→{{header|Forth}}: bug) |
||
Line 163: | Line 163: | ||
=={{header|Forth}}== |
=={{header|Forth}}== |
||
Forth has a global user variable, BASE, which determines the radix used for parsing, interpretation, and printing of integers. This can handle bases from 2-36, but there are two words to switch to the most popular bases, DECIMAL and HEX. |
Forth has a global user variable, BASE, which determines the radix used for parsing, interpretation, and printing of integers. This can handle bases from 2-36, but there are two words to switch to the most popular bases, DECIMAL and HEX. |
||
42 |
42 dup |
||
2 base ! |
2 base ! |
||
. \ 101010 |
. \ 101010 |