#maths #combinatorics #prime

factorial

Convenient methods to compute the factorial, optionally checked

5 unstable releases

0.4.0 Nov 23, 2023
0.3.0 Nov 16, 2022
0.2.1 Dec 17, 2020
0.2.0 Dec 3, 2019
0.1.1 Jul 4, 2018

#358 in Math

Download history 117/week @ 2023-12-21 64/week @ 2023-12-28 134/week @ 2024-01-04 226/week @ 2024-01-11 151/week @ 2024-01-18 130/week @ 2024-01-25 62/week @ 2024-02-01 96/week @ 2024-02-08 133/week @ 2024-02-15 211/week @ 2024-02-22 149/week @ 2024-02-29 160/week @ 2024-03-07 157/week @ 2024-03-14 215/week @ 2024-03-21 176/week @ 2024-03-28 131/week @ 2024-04-04

702 downloads per month
Used in 14 crates (10 directly)

MIT license

16KB
432 lines

Compute factorials

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 loglog n)^2) operations of multiplication. The time complexity of this algorithm depends on the time complexity of the multiplication algorithm used.

Dependencies

~1MB
~13K SLoC