Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- blockSize m b = the number of base-b digits that can be represented by
- -- an Integer < m. Hint: calculate this by repeatedly multiplying 1 by b
- -- until you get >= m, returning one less than the number of multiplications
- blockSize :: Integer -> Int -> Int
- blockSize m b = mult' 1 0
- where mult' a c
- | a >= m = c-1
- | otherwise = mult' (a * toInteger b) (c+1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement