@@ -57,7 +57,7 @@ def test_pyflint():
57
57
assert 1e-17 < f1 .rad () < 1e-15
58
58
assert 1e-4 < f2 .rad () < 1e-3
59
59
finally :
60
- ctx .prec = oldprec
60
+ ctx .dps = olddps
61
61
62
62
assert ctx .cap == 10
63
63
oldcap = ctx .cap
@@ -74,9 +74,11 @@ def test_pyflint():
74
74
assert raises (lambda : setattr (ctx , "prec" , - 1 ), ValueError )
75
75
assert raises (lambda : setattr (ctx , "dps" , - 1 ), ValueError )
76
76
77
+
77
78
def test_showgood ():
78
79
from flint import good , showgood
79
80
81
+
80
82
def test_fmpz ():
81
83
assert flint .fmpz () == flint .fmpz (0 )
82
84
L = [0 , 1 , 2 , 3 , 2 ** 31 - 1 , 2 ** 31 , 2 ** 63 - 1 , 2 ** 63 , 2 ** 64 - 1 , 2 ** 64 ]
@@ -246,9 +248,9 @@ def test_fmpz():
246
248
assert raises (lambda : f2 ^ (), TypeError )
247
249
assert raises (lambda : () ^ f2 , TypeError )
248
250
249
- l = [1 , 2 , 3 ]
250
- l [flint .fmpz (1 )] = - 2
251
- assert l == [1 , - 2 , 3 ]
251
+ ell = [1 , 2 , 3 ]
252
+ ell [flint .fmpz (1 )] = - 2
253
+ assert ell == [1 , - 2 , 3 ]
252
254
d = {flint .fmpz (2 ): 3 }
253
255
d [flint .fmpz (2 )] = - 1
254
256
@@ -1635,6 +1637,7 @@ def test_pickling():
1635
1637
obj2 = pickle .loads (s )
1636
1638
assert obj == obj2
1637
1639
1640
+
1638
1641
def test_fmpz_mod ():
1639
1642
from flint import fmpz_mod_ctx , fmpz , fmpz_mod
1640
1643
@@ -1836,6 +1839,7 @@ def test_fmpz_mod():
1836
1839
assert fmpz (test_y ) / F_test (test_x ) == (test_y * pow (test_x , - 1 , test_mod )) % test_mod
1837
1840
assert test_y / F_test (test_x ) == (test_y * pow (test_x , - 1 , test_mod )) % test_mod
1838
1841
1842
+
1839
1843
def test_fmpz_mod_dlog ():
1840
1844
from flint import fmpz , fmpz_mod_ctx
1841
1845
@@ -1942,7 +1946,7 @@ def test_fmpz_mod_poly():
1942
1946
assert raises (lambda : R ([F (1 ), F_other (2 )]), ValueError ) # moduli must match
1943
1947
assert raises (lambda : R ([F (1 ), "A" ]), TypeError ) # need to be able to cast to fmpz_mod
1944
1948
1945
- f1 = R ([int ( - 1 ), int ( - 2 ), int ( - 3 ) ])
1949
+ f1 = R ([- 1 , - 2 , - 3 ])
1946
1950
f2 = R ([fmpz (- 1 ),fmpz (- 2 ),fmpz (- 3 )])
1947
1951
f3 = R ([F (- 1 ),F (- 2 ),F (- 3 )])
1948
1952
f4 = R (fmpz_poly ([- 1 , - 2 , - 3 ]))
@@ -2264,8 +2268,8 @@ def test_fmpz_mod_poly():
2264
2268
assert raises (lambda : R_test ([1 ,2 ,3 ]).multipoint_evaluate ("AAA" ), ValueError )
2265
2269
2266
2270
f = R_test ([1 ,2 ,3 ])
2267
- l = [- 1 ,- 2 ,- 3 ,- 4 ,- 5 ]
2268
- assert [f (x ) for x in l ] == f .multipoint_evaluate (l )
2271
+ ell = [- 1 ,- 2 ,- 3 ,- 4 ,- 5 ]
2272
+ assert [f (x ) for x in ell ] == f .multipoint_evaluate (ell )
2269
2273
2270
2274
# truncate things
2271
2275
0 commit comments