Advertisement
Guest User

aajj

a guest
May 4th, 2016
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. powTR x n = powTRh x n 1
  2.         where
  3.          powTRh _ 0 1 = 1
  4.          powTRh _ 0 acc = acc
  5.          powTRh x n acc = powTRh x (n - 1) $! (x * acc)
  6.          
  7. countDigitsTR n = countDigitsTRh n 0
  8.             where
  9.              countDigitsTRh n acc | (abs n <= 9) = acc + 1
  10.                           | otherwise = countDigitsTRh (quot n 10) $! (acc + 1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement