Skip to content

Commit

Permalink
Merge branch 'sage_rings_optional_annotations' into sd117_more_option…
Browse files Browse the repository at this point in the history
…al_doctest_tags
  • Loading branch information
Matthias Koeppe committed Apr 9, 2023
2 parents 82fa637 + d8bd93c commit 4b6a8df
Show file tree
Hide file tree
Showing 28 changed files with 1,269 additions and 1,137 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
6 changes: 4 additions & 2 deletions src/sage/rings/fraction_field.py
Original file line number Diff line number Diff line change
Expand Up @@ -802,7 +802,8 @@ def ngens(self):
EXAMPLES::
sage: R = Frac(PolynomialRing(QQ,'z',10)); R
Fraction Field of Multivariate Polynomial Ring in z0, z1, z2, z3, z4, z5, z6, z7, z8, z9 over Rational Field
Fraction Field of Multivariate Polynomial Ring
in z0, z1, z2, z3, z4, z5, z6, z7, z8, z9 over Rational Field
sage: R.ngens()
10
"""
Expand All @@ -815,7 +816,8 @@ def gen(self, i=0):
EXAMPLES::
sage: R = Frac(PolynomialRing(QQ,'z',10)); R
Fraction Field of Multivariate Polynomial Ring in z0, z1, z2, z3, z4, z5, z6, z7, z8, z9 over Rational Field
Fraction Field of Multivariate Polynomial Ring
in z0, z1, z2, z3, z4, z5, z6, z7, z8, z9 over Rational Field
sage: R.0
z0
sage: R.gen(3)
Expand Down
Loading

0 comments on commit 4b6a8df

Please sign in to comment.