Advertisement
Guest User

Untitled

a guest
Apr 21st, 2019
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.12 KB | None | 0 0
  1. toBin 0 = [0]
  2. toBin n
  3. | n `mod` 2 == 1 = toBin (n `div` 2) ++ [1]
  4. | n `mod` 2 == 0 = toBin (n `div` 2) ++ [0]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement