How compile time recursion works?

后端 未结 5 2162
没有蜡笔的小新
没有蜡笔的小新 2021-02-04 01:44

I found a code here Printing 1 to 1000 without loop or conditionals

Can someone please explain how compile time recursion works, couldn\'t find it in google



        
5条回答
  •  臣服心动
    2021-02-04 02:38

    You have factorial calculation explained here.

    btw that a note that your function doesn't work for negative numbers.

提交回复
热议问题