This repository has been archived by the owner on Jan 30, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
remove compile-time dependency on flint from integer
- Loading branch information
Jonathan Kliem
committed
Aug 28, 2021
1 parent
9986723
commit c08a8b5
Showing
2 changed files
with
28 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
def n_factor_to_list(unsigned long n, int proved): | ||
""" | ||
A wrapper around ``n_factor``. | ||
EXAMPLES:: | ||
sage: from sage.libs.flint.ulong_extras import n_factor_to_list | ||
sage: n_factor_to_list(60, 20) | ||
[(2, 2), (3, 1), (5, 1)] | ||
sage: n_factor_to_list((10**6).next_prime() + 1, 0) | ||
[(2, 2), (53, 2), (89, 1)] | ||
""" | ||
cdef n_factor_t f | ||
n_factor_init(&f) | ||
n_factor(&f, n, proved) | ||
return [(f.p[i], int(f.exp[i])) for i in range(f.num)] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters