2015-12-08 124 views
3

的精確值。當我在控制檯中運行factorial(100),我得到如何獲得階乘(100)

factorial(100) 
# [1] 9.332622e+157 

但我想看到的factorial(100)精確值。我會怎麼做?

回答

4

gmp圖書館可能會做你想做的。我還沒有證實這是正確的結果:

> library(gmp) 
> j <- as.bigz(100) 
> factorial(j) 
Big Integer ('bigz') : 
[1] 93326215443944152681699238856266700490715968264381621468592963895217599993229915608941463976156518286253697920827223758251185210916864000000000000000000000000 

Multiplication of large integers in R

+0

參見[右似乎](http://www.geeksforgeeks.org/factorial-large-number/)如果這是值得信賴 –