Created
December 31, 2009 12:51
-
-
Save balinterdi/266717 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (defn to-binary | |
| ([number] | |
| (apply str (to-binary number []))) | |
| ([number digits] | |
| (if | |
| (or (= 0 number) (= 1 number)) (cons number digits) | |
| (recur (quot number 2) (cons (rem number 2) digits)))) | |
| ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment