全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 Excel
3184 3
2011-05-03
请问怎么在Excel里做大于300的阶乘呀?谢谢啦!
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

全部回复
2011-5-3 14:19:34
瞧一瞧
http://amulee.bokee.com/6960395.html

如何计算大数阶乘的精确值?
关键词: 大数    阶乘    VBA                                          

在Excel VBA中,虽然可以计算大数的阶乘,但是其精度仅10多位。对于大数的阶乘精确值却无能为力。其实,我们可以利用数组存放每一位的数字,来模拟乘法的运算计算大数的阶乘。代码如下:
复制代码
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2011-5-3 14:21:59
再瞧一瞧这个链接,希望对你有帮助。
http://tutorialsto.com/index.php ... arge-numbers-d.html

The calculation of factorial of large numbers (d)

Print View by: iSee Total views: 45 Word Count: 553 Date: Fri, 22 May 2009 Time: 2:06 PM

Read northwolves article the calculation of factorial of large numbers (c) http://dev.csdn.net/article/28/28432.shtm very enlightening, reminiscent of the past I have written a similar function, methods and its almost all is a dynamic array by way of digital preservation. Efficient than northwolves poor brother to some, about a difference of 50%; thought factorial algorithm is the fastest, so this article is to see is admirable!

However, I think that this algorithm can also optimize the room, so, once again done something new to try, do not want a big success, efficiency than the calculation of factorial of large numbers (c) once again increased more than 5 times, and algorithm is simple and amazingly, they did not dareimmediately posted to share with you.
复制代码
Output: (My machine is running "calculation of (c)" when, instead of the result of considerable, it should be with the northwolves brother, with the level of the machine)

100! : 0 seconds when the results 158
200! : 1.171875E-02 Time seconds, the results of 375
300! : 3.515625E-02 Time seconds, the results of 615
400! : 4.296875E-02 Time seconds, the results of 869
500! : 8.203125E-02 Time seconds, the results of 1135
600! : .1054688 Seconds when a result, 1409
700! : .15625 Seconds when a result, 1690
800! : .1992188 Seconds when a result, 1977
900! : .2617188 Seconds when a result, 2270
1000! : .3632813 Seconds when a result, 2568
2000! : 1.53125 seconds with the time, the results of 5736
3000! : Used 3.75 seconds, resulting in 9131
4000! : 7.171875 seconds when a result, 12,674
5000! : 11.45313 seconds when a result, 16,326
6000! : 16.41016 seconds when a result, 20,066
7000! : 22.83984 seconds when a result, 23,878
8000! : 30.375 seconds used, resulting in 27,753
9000! : Used 41.75 seconds, resulting in 31,682
10000! : 54.57813 seconds when a result, 35,660

The output have been a bit slow because I am the first test in the 10000! Only spent 47 seconds. I wonder if there will be a faster algorithm.
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2011-5-5 09:21:58
谢谢R大人!原来这么复杂呢呀。。。
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群