home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Simtel MSDOS 1992 September
/
Simtel20_Sept92.cdr
/
msdos
/
editor
/
me_cd.arc
/
TOBASE.MUT
< prev
next >
Wrap
Text File
|
1988-09-23
|
410b
|
17 lines
; tobase(n,base): convert n (base 10) to base. eg (tobase 10 16) => A
; C Durland
(include mod.mut)
(defun
tobase (int n base) HIDDEN
{
(if (< n base) (substr "0123456789ABCDEF" n 1)
(concat
(tobase (/ n base) base) ; tobase n/base base
(tobase (mod n base) base) ; tobase (n mod base) base
)
)
}
)
;(msg (tobase (atoi (ask "n = "))(atoi (ask "base = "))))