一、作用 斯特林公式(Stirling's approximation)是一条用来取n的阶乘的近似值的数学公式。主要用于近似n的阶乘的位数,但是在n=1时近似情况不是特别理想 二、公式 ll getLen(ll n) { return ll(log10(sqrt(4*acos(0.0)*n))+n*log10(n/exp(1.0)))+1; }