Guest User

Untitled

a guest
Jul 21st, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.14 KB | None | 0 0
  1. bitsOn n
  2. | n <= 0 = []
  3. | otherwise = lgN: bitsOn (n - 2**lgN)
  4. where lgN = toInteger $ truncate $ logBase 2 fromIntegral $ n
Add Comment
Please, Sign In to add comment