3 ms·
digitLength n = if n < 10 then 1 else 1 + digitLength (n / 10) Avoiding loops by recursion is no worse than avoiding loops by calling a looping library functio
by tromp 7y ago
digitLength n = if n < 10 then 1 else 1 + digitLength (n / 10)
Avoiding loops by recursion is no worse than avoiding loops by calling a looping library function...