Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
using += where possible in p1list
Browse files Browse the repository at this point in the history
  • Loading branch information
fchapoton committed May 24, 2022
1 parent 4ed5382 commit 5bfe5e1
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions src/sage/modular/modsym/p1list.pyx
Expand Up @@ -69,9 +69,9 @@ cdef int c_p1_normalize_int(int N, int u, int v,
u = u % N
v = v % N
if u < 0:
u = u + N
u += N
if v < 0:
v = v + N
v += N
if u == 0:
uu[0] = 0
if arith_int.c_gcd_int(v,N) == 1:
Expand All @@ -84,7 +84,7 @@ cdef int c_p1_normalize_int(int N, int u, int v,
g = arith_int.c_xgcd_int(u, N, &s, &t)
s = s % N
if s < 0:
s = s + N
s += N
if arith_int.c_gcd_int(g, v) != 1:
uu[0] = 0
vv[0] = 0
Expand Down Expand Up @@ -116,9 +116,9 @@ cdef int c_p1_normalize_int(int N, int u, int v,
min_t = t
v = min_v
if u < 0:
u = u+N
u += N
if v < 0:
v = v+N
v += N
uu[0] = u
vv[0] = v
if compute_s:
Expand Down Expand Up @@ -329,9 +329,9 @@ cdef int c_p1_normalize_llong(int N, int u, int v,
u = u % N
v = v % N
if u < 0:
u = u + N
u += N
if v < 0:
v = v + N
v += N
if u == 0:
uu[0] = 0
if arith_int.c_gcd_int(v,N) == 1:
Expand All @@ -347,7 +347,7 @@ cdef int c_p1_normalize_llong(int N, int u, int v,
t = <int>(ll_t % ll_N)
s = s % N
if s < 0:
s = s + N
s += N
if arith_int.c_gcd_int(g, v) != 1:
uu[0] = 0
vv[0] = 0
Expand Down Expand Up @@ -380,9 +380,9 @@ cdef int c_p1_normalize_llong(int N, int u, int v,
min_t = t
v = min_v
if u < 0:
u = u+N
u += N
if v < 0:
v = v+N
v += N
uu[0] = u
vv[0] = v
if compute_s:
Expand Down Expand Up @@ -619,9 +619,9 @@ cdef int p1_normalize_xgcdtable(int N, int u, int v,
u = u % N
v = v % N
if u < 0:
u = u + N
u += N
if v < 0:
v = v + N
v += N
if u == 0:
uu[0] = 0
if t_g[v] == 1: # "if arith_int.c_gcd_int(v,N) == 1"
Expand All @@ -637,7 +637,7 @@ cdef int p1_normalize_xgcdtable(int N, int u, int v,
t = t_b[u]
s = s % N
if s < 0:
s = s + N
s += N
if g != 1 and arith_int.c_gcd_int(g, v) != 1:
uu[0] = 0
vv[0] = 0
Expand Down Expand Up @@ -669,9 +669,9 @@ cdef int p1_normalize_xgcdtable(int N, int u, int v,
min_t = t
v = min_v
if u < 0:
u = u+N
u += N
if v < 0:
v = v+N
v += N
uu[0] = u
vv[0] = v
if compute_s:
Expand Down Expand Up @@ -1274,7 +1274,7 @@ def lift_to_sl2z_int(int c, int d, int N):
if g == 1:
break
m = m / g
d = d + N*m
d += N * m
g = arith_int.c_xgcd_int(c, d, &z1, &z2)

if g != 1:
Expand Down Expand Up @@ -1344,7 +1344,7 @@ def lift_to_sl2z_llong(llong c, llong d, int N):
if g == 1:
break
m = m / g
d = d + N*m
d += N * m
g = arith_llong.c_xgcd_longlong(c, d, &z1, &z2)

if g != 1:
Expand Down

0 comments on commit 5bfe5e1

Please sign in to comment.