Nah, tail recursion optimization can just reuse the same stack frame again and again. It’s going to loop until it wraps around what ever integer width it has and then tells you if the biggest integer is even or odd. Or, if it’s nice, it’s going to complain about the wrap around
isEven(0) -> true; isEven(Num) -> isOdd(Num-1). isOdd(0) -> false; isOdd(Num) -> isEven(Num-1).
Hmm.
isEven(-2)…<out of stack error>
Nah, tail recursion optimization can just reuse the same stack frame again and again. It’s going to loop until it wraps around what ever integer width it has and then tells you if the biggest integer is even or odd. Or, if it’s nice, it’s going to complain about the wrap around