Skip to content

Commit

Permalink
sage.rings: Doctest cosmetics
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthias Koeppe committed Apr 8, 2023
1 parent 82fa637 commit b55ba8f
Show file tree
Hide file tree
Showing 9 changed files with 472 additions and 427 deletions.
12 changes: 6 additions & 6 deletions src/sage/rings/factorint.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -202,9 +202,9 @@ cpdef factor_aurifeuillian(n, check=True):

def factor_cunningham(m, proof=None):
r"""
Return factorization of self obtained using trial division
Return factorization of ``self`` obtained using trial division
for all primes in the so called Cunningham table. This is
efficient if self has some factors of type `b^n+1` or `b^n-1`,
efficient if ``self`` has some factors of type `b^n+1` or `b^n-1`,
with `b` in `\{2,3,5,6,7,10,11,12\}`.
You need to install an optional package to use this method,
Expand Down Expand Up @@ -245,12 +245,12 @@ def factor_cunningham(m, proof=None):

cpdef factor_trial_division(m, long limit=LONG_MAX):
r"""
Return partial factorization of self obtained using trial division
for all primes up to limit, where limit must fit in a C signed long.
Return partial factorization of ``self`` obtained using trial division
for all primes up to ``limit``, where ``limit`` must fit in a C ``signed long``.
INPUT:
- ``limit`` -- integer (default: ``LONG_MAX``) that fits in a C signed long
- ``limit`` -- integer (default: ``LONG_MAX``) that fits in a C ``signed long``
EXAMPLES::
Expand Down Expand Up @@ -294,7 +294,7 @@ def factor_using_pari(n, int_=False, debug_level=0, proof=None):
r"""
Factor this integer using PARI.
This function returns a list of pairs, not a ``Factorization``
This function returns a list of pairs, not a :class:`Factorization`
object. The first element of each pair is the factor, of type
``Integer`` if ``int_`` is ``False`` or ``int`` otherwise,
the second element is the positive exponent, of type ``int``.
Expand Down
16 changes: 8 additions & 8 deletions src/sage/rings/fast_arith.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -59,16 +59,16 @@ cpdef prime_range(start, stop=None, algorithm=None, bint py_ints=False):
- ``algorithm`` -- optional string (default: ``None``), one of:
- ``None``: Use algorithm ``"pari_primes"`` if ``stop`` <= 436273009
(approximately 4.36E8). Otherwise use algorithm ``"pari_isprime"``.
- ``None``: Use algorithm ``"pari_primes"`` if ``stop`` <= 436273009
(approximately 4.36E8). Otherwise use algorithm ``"pari_isprime"``.
- ``"pari_primes"``: Use PARI's :pari:`primes` function to generate all
primes from 2 to stop. This is fast but may crash if there is
insufficient memory. Raises an error if ``stop`` > 436273009.
- ``"pari_primes"``: Use PARI's :pari:`primes` function to generate all
primes from 2 to stop. This is fast but may crash if there is
insufficient memory. Raises an error if ``stop`` > 436273009.
- ``"pari_isprime"``: Wrapper for ``list(primes(start, stop))``. Each (odd)
integer in the specified range is tested for primality by applying PARI's
:pari:`isprime` function. This is slower but will work for much larger input.
- ``"pari_isprime"``: Wrapper for ``list(primes(start, stop))``. Each (odd)
integer in the specified range is tested for primality by applying PARI's
:pari:`isprime` function. This is slower but will work for much larger input.
- ``py_ints`` -- optional boolean (default ``False``), return Python ints rather
than Sage Integers (faster). Ignored unless algorithm ``"pari_primes"`` is being
Expand Down
Loading

0 comments on commit b55ba8f

Please sign in to comment.