Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- toBin 0 = [0]
- toBin n
- | n `mod` 2 == 1 = toBin (n `div` 2) ++ [1]
- | n `mod` 2 == 0 = toBin (n `div` 2) ++ [0]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement