How can one compute the Ackermann function over nonnegative real numbers in Python per this question on Mathoverflow?
Here is my code for integers.
def naive_ackermann(m, n):
global calls
calls += 1
if m == 0:
return n + 1
elif n == 0:
return naive_ackermann(m - 1, 1)
else:
return naive_ackermann(m - 1, naive_ackermann(m, n - 1))
I tried using float and allowing it to go in between 0 and 1 but it was not continuous.