Created
January 28, 2009 05:39
-
-
Save stevestreza/53837 to your computer and use it in GitHub Desktop.
This file contains 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
numberToList :: Integer -> [Integer] | |
numberToList x | |
| x == 0 = [] | |
| x < 10 = [x] | |
| otherwise = (numberToList left) ++ (numberToList right) | |
where left = x `div` 10 | |
right = x `mod` 10 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment