WIP (fixed conv)

This commit is contained in:
Adam Cooper 2025-01-25 19:34:46 -05:00
parent 4e3ea1a878
commit 4f47fd99a0

View file

@ -4,12 +4,10 @@
(in-package :all-your-base)
; conv converts a list representation to base 10 number
; This is complete but incorrect
(defun conv (l base)
(if (null l)
0
(+ (* (first l) (expt base (- (length l) 1)) (conv (rest l) base)))))
(+ (* (first l) (expt base (- (length l) 1))) (conv (rest l) base))))
(defun calc-start-exponent (num base x)
(if (< num (expt base (1+ x)))
@ -28,4 +26,5 @@
(append (list q) (unconv r base (- x 1)))))))
(defun rebase (l source destination)
(print (list l source destination))
(unconv (conv l source) destination -1))