计算阶乘是递归程序设计的一个经典示例。
The classic example of recursive programming involves computing factorials.
在寄存器3中想要做的是计算此值的阶乘。
What you want to do with this value in register 3 is to calculate the factorial of it.
这样将产生一个相对简单的结果,因为阶乘被消去了。
So this is going to turn out to be a relatively simple case, because the factorials are going to cancel.
它的功能还包含计算三角函数,阶乘,排列和组合的计算。
Some of the features include trigonometry, factorials, permutations and combinations.
计算了阶乘之后,现在需要用printf将其打印出来。
After computing the factorial, you now want to print it out using printf.
否则,使用递归函数计算阶乘。
Otherwise, a recursive function is used to calculate the factorial.
写出一个用递归来计算阶乘的函数。
Write a function that calculates a number's factorial using recursion.
如何使用扩展精度运算处理更大的阶乘?
How to use extended precision arithmetic to handle bigger factorials?
结果稍后将显示在阶乘按钮下方的标签中。
Results will later be displayed in the labels beneath the factorial buttons.
什么是两阶乘计算任意精度比的一种有效途径?
What would be an efficient way of calculating ratio of two factorials with arbitrary precision?
作为直接推论给出了中心阶乘数反演关系的新证明。
As immediate consequence of our results we give a new proof of the inverse relations of central factorial Numbers.
下面同样是计算阶乘的方法,这次是针对Duby编译器而写的。
The same method to calculate the factorial, this time written for the Duby compiler.
例如,如果我们要计算4的阶乘为多少,到底会发生什么呢?
What happens, for instance, if you try to find the value of the factorial of 4? Let's follow the sequence
计算某个数的阶乘就是用那个数去乘包括1在内的所有比它小的数。
The factorial of a number is computed as that number times all of the Numbers below it up to and including 1.
显然,差分算子及其逆算子是阶乘幂多项式的方便工具。
Clearly, the difference operator or sum operator is the convenient tool for the polynomial of factorial powers.
用蒙特-卡洛模拟方法对纵向阶乘矩和横向阶乘矩进行了比较和研究。
The difference in the horizontal and vertical factorial moments is compared and studied using Monte-Carlo simulation.
这个功能作为递归应用程序工作良好,如清单4中的样本阶乘函数所示。
This functionality works well as a recursive application, as shown in the sample factorial function in Listing 4.
测试用例包含几个简单的命令参数处理,然后是一个循环,它计算指定值(如果有的话)的阶乘。
The test case consists of some simple command argument processing followed by a loop that calculates the factorial of the specified values (if any).
在开始介绍SPU汇编语言之前,先来看一个通过递归算法计算32 位数的阶乘的简单程序。
To begin looking at SPU assembly language, I will enter in a simple program for calculating the factorial of a 32-bit number using a recursive algorithm.
依照伽马函数,对通常的阶乘、排列、组合的概念进行了推广,并证明了一些常用的组合公式。
Using gamma function, the paper popularized the common conceptions of the usual factorial, permutation and combination and proved some combination formulas in common use.
复杂算法通常比较容易使用递归实现。事实上,有些传统算法正是以递归实现的,诸如阶乘函数。
Complex algorithms are typically made easier by using recursion. In fact, there are some traditional algorithms that presume recursion as the implementation, such as a function to return factorials.
然后,由于 num大于0,因此会再次调用factorial,不过这次是计算3 的阶乘了。
Then, because num is greater than 0, factorial will be called again, this time with 3.
这段代码看起来比较多,但您也无需望而却步,因为其中大部分都是注释和声明(阶乘函数本身只有16个指令)。
Don't be taken aback by the size of the code — it's mostly comments and declarations (the factorial function itself only has 16 instructions).
这里是一个阶乘计算器的实现,我们会使用一种常规的方法,通过调用第二个,嵌套的方法来完成计算。
Here is an implementation of a factorial calculator, where we use a conventional technique of calling a second, nested method to do the work.
阶乘的一个有趣特性是,某个数的阶乘等于起始数(startingnumber)乘以比它小一的数的阶乘。
An interesting property of a factorial is that the factorial of a number is equal to the starting number multiplied by the factorial of the number immediately below it.
科学计算,加、减、乘、除、开方、平方、三次方、三角函数(sincos tan)、阶乘、求反、取模等。
Scientific calculator supporting addition, subtraction, multiplication, division, square-root, square, cube, sin, cos, tan, Factorial, inverse, modulus.
在大多数教程中可以发现的大多数经典Haskell函数都是递归的数学函数,例如fibonacci函数和阶乘。
The classic Haskell functions that you'll find in most tutorials are recursive math functions, such as Fibonacci functions and factorials.
由于小于1的数的阶乘没有任何意义,所以我们在计算到数字 1 的时候停止,并返回 1的阶乘(即 1)。
Since factorials of numbers less than 1 don't make any sense, we stop at the number 1 and return the factorial of 1 (which is 1). Therefore, the real factorial function will look like this
第 5章介绍了划分问题、递归函数到迭代函数的转换(我可以向您保证,这非常有趣)以及阶乘和斐波纳级数的实现。
Chapter 5 deals with partitioning problems, converting recursive functions to iterative functions (it's fun, I assure you), and more factorial and Fibonacci series implementations.
第 5章介绍了划分问题、递归函数到迭代函数的转换(我可以向您保证,这非常有趣)以及阶乘和斐波纳级数的实现。
Chapter 5 deals with partitioning problems, converting recursive functions to iterative functions (it's fun, I assure you), and more factorial and Fibonacci series implementations.
应用推荐