Skip to content

An R pacakge to calculate the factorial of a natural number.

Notifications You must be signed in to change notification settings

xliusufe/FactSum

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

70 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FactSum

R package "FactSum" Calculates the factorial of a large integer, which may be much greater than the maximum memory of any data type. FactSum implements dramatically fast. It takes only 0.45 seconds to cumpute 10000! (it approximates 2.8E+35660), and 0.98 seconds to compute 10000! and sum=1!+2!+3!+...+10000! simultaneously. It takes only one minute to cumpute 100000! (it approximates 2.8E+456574), and less then two minutes to compute 100000! and sum=1!+2!+3!+...+100000! simultaneously.

Installation

#install.packages("devtools")
library(devtools)
install_github("xliusufe/FactSum")

Usage

  • FactSum-manual.pdf ---------- Details of the usage of the package.

  • factorial.md -------------------- The factorial of n=20, 50, 100, 1000, 10000, and 100000.

  • Web-based calculator --------- A web-based calculator

  • "fact" -------------------------- The corresponding Python package is available

Example

library(FactSum)

fit <- fact(10)
print(fit$fact,quote=FALSE)
fit$len_fact
fit$nzeros
#------------------------
fit_sum <- fact(20,1)
print(fit_sum$fact,quote=FALSE)
fit_sum$len_fact
fit_sum$nzeros
print(fit_sum$fact_sum,quote=FALSE)
fit_sum$len_sum
fit_sum$nzeros

Development

This R package is developed by Xu Liu (liu.xu@sufe.edu.cn).

About

An R pacakge to calculate the factorial of a natural number.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published