WIP
This commit is contained in:
parent
8cbf0b109b
commit
4e3ea1a878
2 changed files with 7 additions and 10 deletions
Binary file not shown.
|
@ -17,18 +17,15 @@
|
|||
(calc-start-exponent num base (1+ x))))
|
||||
|
||||
(defun unconv (num base exponent)
|
||||
; TODO
|
||||
; Compiler calls x and undefined variable, so I need to fix this
|
||||
; `setq` call.
|
||||
(setq x
|
||||
(let ((x
|
||||
(if (eq exponent -1)
|
||||
(calc-start-exponent num base 0)
|
||||
exponent))
|
||||
(if (eq x 0)
|
||||
(list num)
|
||||
(multiple-value-bind (q r)
|
||||
(truncate (/ num (expt base x)))
|
||||
(append (list q) (unconv r base (- x 1))))))
|
||||
exponent)))
|
||||
(if (eq x 0)
|
||||
(list num)
|
||||
(multiple-value-bind (q r)
|
||||
(truncate (/ num (expt base x)))
|
||||
(append (list q) (unconv r base (- x 1)))))))
|
||||
|
||||
(defun rebase (l source destination)
|
||||
(unconv (conv l source) destination -1))
|
||||
|
|
Loading…
Add table
Reference in a new issue