When I run factorial(100)
in the console, I get
factorial(100)
# [1] 9.332622e+157
But I want to see the exact value of factorial(100)
. How would I do it?
The gmp
library might do what you want. I have not verified that this is the correct result:
> library(gmp)
> j <- as.bigz(100)
> factorial(j)
Big Integer ('bigz') :
[1] 93326215443944152681699238856266700490715968264381621468592963895217599993229915608941463976156518286253697920827223758251185210916864000000000000000000000000
See also Multiplication of large integers in R
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With