#prime #combinatorics #maths

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

#921 in Math

Download history 832/week @ 2024-06-15 312/week @ 2024-06-22 614/week @ 2024-06-29 207/week @ 2024-07-06 507/week @ 2024-07-13 649/week @ 2024-07-20 762/week @ 2024-07-27 361/week @ 2024-08-03 464/week @ 2024-08-10 590/week @ 2024-08-17 453/week @ 2024-08-24 402/week @ 2024-08-31 269/week @ 2024-09-07 293/week @ 2024-09-14 315/week @ 2024-09-21 292/week @ 2024-09-28

1,233 downloads per month
Used in 18 crates (13 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