Skip to content

Commit

Permalink
fix documentation and doctest for qfbcornacchia() -- see sagemath#35292
Browse files Browse the repository at this point in the history
  • Loading branch information
yyyyx4 committed Apr 14, 2023
1 parent 97b45d8 commit 4c0995f
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/sage/quadratic_forms/binary_qf.py
Original file line number Diff line number Diff line change
Expand Up @@ -1569,9 +1569,10 @@ def solve_integer(self, n, *, algorithm="general"):
sage: Q.solve_integer(773187972)
(4919, 1337)
If `Q` is of the form `[1,0,c]` as above and `n` is a prime or
four times a prime, Cornacchia's algorithm can be used, which is
typically much faster than the general method::
If `Q` is of the form `[1,0,c]` as above and `n` is a prime
(or four times a prime whenever `c \equiv 3 \pmod 4`), then
Cornacchia's algorithm can be used, which is typically much
faster than the general method::
sage: Q = BinaryQF([1, 0, 12345])
sage: n = 2^99 + 5273
Expand Down Expand Up @@ -1611,7 +1612,7 @@ def solve_integer(self, n, *, algorithm="general"):
sage: abc = [1,0,randrange(1,10^3)]
sage: Q = BinaryQF(abc)
sage: n = random_prime(10^9)
sage: if randrange(2):
sage: if Q[2] % 4 == 3 and randrange(2):
....: n *= 4
sage: xy1 = Q.solve_integer(n, algorithm='cornacchia')
sage: xy1 is None or Q(*xy1) == n
Expand Down

0 comments on commit 4c0995f

Please sign in to comment.