Commit 2ad84aa
* Improve `factorial(n, k)` performance for `BigInt`
Use in-place operations from `Base.GMP.MPZ` to reduce allocations.
* Add tests for `factorial(::BigInt, ::BigInt)`
* Avoid mutating first input of `factorial(::BigInt, ::BigInt)`
Co-authored-by: Chengyu Han <[email protected]>
---------
Co-authored-by: Chengyu Han <[email protected]>
1 parent 9bcadfa commit 2ad84aa
2 files changed
+15
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
31 | 43 | | |
32 | 44 | | |
33 | 45 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
6 | 9 | | |
7 | 10 | | |
8 | 11 | | |
| |||
0 commit comments