#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

#939 in Math

Download history 679/week @ 2024-07-22 671/week @ 2024-07-29 407/week @ 2024-08-05 548/week @ 2024-08-12 525/week @ 2024-08-19 484/week @ 2024-08-26 331/week @ 2024-09-02 262/week @ 2024-09-09 284/week @ 2024-09-16 351/week @ 2024-09-23 281/week @ 2024-09-30 409/week @ 2024-10-07 718/week @ 2024-10-14 549/week @ 2024-10-21 807/week @ 2024-10-28 875/week @ 2024-11-04

2,966 downloads per month
Used in 19 crates (14 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

~795KB
~13K SLoC