Skip to content

Commit bd5df79

Browse files
author
Release Manager
committed
gh-38797: make sure .division_points() returns the correct result for m=-1 Fixes #38796: The solution is to simply take the sign of $m$ into account when $m \in \{\pm1\}$. URL: #38797 Reported by: Lorenz Panny Reviewer(s):
2 parents e70d9fe + cf5e86d commit bd5df79

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/sage/schemes/elliptic_curves/ell_point.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1148,12 +1148,19 @@ def division_points(self, m, poly_only=False):
11481148
3
11491149
sage: [(Q,Q._order) for Q in P.division_points(4)]
11501150
[((-2 : -7 : 1), 6), ((1 : 2 : 1), 6), ((4 : -7 : 1), 3), ((13 : 38 : 1), 6)]
1151+
1152+
Check for :issue:`38796`::
1153+
1154+
sage: E = EllipticCurve(GF(127), [1,1])
1155+
sage: P = E(72, 24)
1156+
sage: [-1*Q for Q in P.division_points(-1)]
1157+
[(72 : 24 : 1)]
11511158
"""
11521159
# Coerce the input m to an integer
11531160
m = Integer(m)
11541161
# Check for trivial cases of m = 1, -1 and 0.
11551162
if m == 1 or m == -1:
1156-
return [self]
1163+
return [m*self]
11571164
if m == 0:
11581165
if self == 0: # then every point Q is a solution, but...
11591166
return [self]

0 commit comments

Comments
 (0)