Thread
:
Ackerman's function - crash upon launch
View Single Post
Oct 15th, 2006, 7:56 PM
#
4
The Dark
Expert Programmer
Join Date: Jun 2005
Posts: 852
Rep Power:
4
You need to change
(
Toggle Plain Text
)
return (A(n + 1,0), 0);
return (A(n + 1,0), 0);
to
(
Toggle Plain Text
)
return n + 1;
return n + 1;
Otherwise there is no way out of the function without calling itself again.
Also note that you don't return anything if m or n is less than 0, you should at least return some value, or throw an exception.
The Dark
View Public Profile
Find More Posts by The Dark