Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- powTR x n = powTRh x n 1
- where
- powTRh _ 0 1 = 1
- powTRh _ 0 acc = acc
- powTRh x n acc = powTRh x (n - 1) $! (x * acc)
- countDigitsTR n = countDigitsTRh n 0
- where
- countDigitsTRh n acc | (abs n <= 9) = acc + 1
- | otherwise = countDigitsTRh (quot n 10) $! (acc + 1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement