Non-decimal radices/Convert: Difference between revisions

→‎{{header|J}}: Added examples of use and reference to #. and #:
No edit summary
(→‎{{header|J}}: Added examples of use and reference to #. and #:)
Line 177:
2b100 8b100 10b100 16b100 36b100 36bzy
4 64 100 256 1296 1294
ThePrograms following providefor conversion of numeric values to literals, and of literals to numbers.:
numerals=: '0123456789abcdefghijklmnopqrstuvwxyz'
baseNtoL=: numerals {~ [ #.^:_1 ]
baseLtoN=: (#~ #) #. numerals i. ]
Examples of use:
2 baseNtoL 100 101
1100100
1100101
16 baseNtoL 26
1a
36 baseLtoN 'zy'
1294
See also primary verbs [http://www.jsoftware.com/help/dictionary/d401.htm Base] and [http://www.jsoftware.com/help/dictionary/d402.htm Antibase].
 
=={{header|Java}}==
Anonymous user