### 5 unstable releases

0.3.0 | Nov 16, 2022 |
---|---|

0.2.1 | Dec 17, 2020 |

0.2.0 | Dec 3, 2019 |

0.1.1 | Jul 4, 2018 |

0.1.0 | Jul 4, 2018 |

#**220** in Math

**641** downloads per month

Used in **15** crates
(11 directly)

**MIT**license

14KB

354 lines

# Compute the factorial

This crate provides some convenient and safe methods to compute the factorial with an efficient method. More precisely it uses the prime swing algorithm to compute the factorial. See this paper for more detail.

It can compute the factorial in $O(n (\log{n} \cdot \log{\log {n}})^2)$ operations of multiplication. The time complexity of this algorithm depends on the time complexity of the multiplication algorithm used.

###
`lib.rs`

:

# Compute the factorial

This crate provides some convenient and safe methods to compute the factorial and related functions the most naive way possible.

They are not necessarily the fastest versions: there are prime sieve methods that
compute the factorial in

. Patches are welcome.`O (n (log n loglog n)^2)`

#### Dependencies

~800KB

~13K SLoC