▲ | nothrabannosir 5 days ago | |
> func pow(uint base, uint n): n == 0 ? return 1 : return n * pow(base, n-1) Nitpick: that’s not tail recursive. Something like def pow(base, n, acc=1) = match n case 0 => acc; default => pow(base, n-1, acc*base) | ||
▲ | pyrale 4 days ago | parent [-] | |
Given that `base` is never used, I suspect that's not the only issue :) |