Base Expansion

How to compute a base b expansion of a number n.

Base expansion is an important mathematical tool throughout computer science and mathematics.

Date Created:Saturday September 27th, 2008 08:57 PM
Date Modified:Sunday September 28th, 2008 03:13 AM

(define (base-expand n b)
  (if (= n 0)
        (base-expand (round (floor (/ n b))) b)
        (list (modulo n b))

Download: base-exp.scm 161 B

Please login or Click Here to register for downloads
Creative Commons License
Base Expansion by Dan Lynch
is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License
Based on a work at
Permissions beyond the scope of this license may be available at