1*2*3*4*5.......*99*100简便计算方法

来源:百度知道 编辑:UC知道 时间:2024/06/25 18:05:32

用Matlab编程算,很简单,可求任意数的阶乘
程序如下:
function output = fact(n)
% FACT Calculate factorial of a given positive integer.
output = 1;
for i = 1:n,
output = output*i;
end

这个函数试计算阶乘的,其中output为结果

1*2*3*4*5.......*99*100=9.3326*10^157

100!没有简便方法。。。。