Commit 8eef43ca274316d3bda889574fb32298d284a532

Thomas de Grivel 2021-02-03T14:48:45

fix base-positional

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/positional.lisp b/positional.lisp
index b6e85be..7d7ac75 100644
--- a/positional.lisp
+++ b/positional.lisp
@@ -77,7 +77,7 @@
          (make-string 1 :initial-element (char base 0)))
         (t
          (let* ((base-n (length base))
-                (out-n (ceiling (log number base-n)))
+                (out-n (1+ (floor (log number base-n))))
                 (out (make-string out-n :initial-element (char base 0)))
                 (i (1- out-n)))
            (loop