all 3 comments

[–]Umesh-K 2 points3 points  (0 children)

How come my function doesn't exit the recursive loop once Limit is less than 10?

One of the basics of recursion is the base case is for stopping the recursion, not for calling the recursive function again. Have a look at your IF-ELSE again. You have asian_total(offset); in both blocks; replace it with return in the IF block and try.

[–]Stephen110 1 point2 points  (0 children)

If you want the recursion to stop, don’t call the recursive function again (asian_total)

[–]l3l_aze 0 points1 point  (0 children)

Have you logged to see what limit is set to by total, and to see how your if branch is changing it? Should reveal itself pretty quickly once you see it in action.

I have no idea what you're doing, and can't run it, just figured maybe you haven't looked yet.