Skip to content

Commit

Permalink
fix #38489
Browse files Browse the repository at this point in the history
  • Loading branch information
yyyyx4 committed Aug 8, 2024
1 parent 0f34773 commit 0b172b1
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/sage/groups/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -1257,6 +1257,17 @@ def order_from_multiple(P, m, plist=None, factorization=None, check=True,
sage: K.<a> = GF(3^60)
sage: order_from_multiple(a, 3^60 - 1, operation='*', check=False)
42391158275216203514294433200
TESTS:
Check that :issue:`38489` is fixed::
sage: from sage.groups.generic import order_from_multiple
sage: plist = [43, 257, 547, 881]
sage: m = prod(plist[:-1])
sage: elt = Zmod(m)(plist[-1])
sage: order_from_multiple(elt, m, plist=plist)
6044897
"""
Z = integer_ring.ZZ

Expand Down Expand Up @@ -1325,6 +1336,8 @@ def _order_from_multiple_helper(Q, L, S):
if abs(sum_left + v - (S / 2)) > abs(sum_left - (S / 2)):
break
sum_left += v
if not 0 < k < l:
k = l // 2
L1 = L[:k]
L2 = L[k:]
# recursive calls
Expand Down

0 comments on commit 0b172b1

Please sign in to comment.