Here is an implementation of a factorial calculator , where we use a conventional technique of calling a second , nested method to do the work .
这里是一个阶乘计算器的实现,我们会使用一种常规的方法,通过调用第二个,嵌套的方法来完成计算。
You may never be asked to solve a complex factorial in the real world , but if your mind understands how to solve these problems , it will be more equipped to deal with the complex problems that do exist in the real world .
In particular , you should recognize that n is the number whose factorial we 're computing , that result holds the accumulating product on each cycle , and that I is once again an unremarkable index variable used to track the progress of the for loop .