Runtime exception, recursion too deep

后端 未结 12 1040
余生分开走
余生分开走 2020-12-19 04:59

I converted the pseudo-code here into C#, and have it recursively repeat 10,000 times. But I get a C# runtime error, StackOverflow Exception after 9217

12条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-19 05:35

    Recursive function calls are almost always a really awful way to do things.

    I would simply get the value of pi from a header file/math library.

提交回复
热议问题