@@ -3741,50 +3741,50 @@ def _all_polys_mpolys():
37413741# assert (2*(x+y)).gcd(4*(x+y)**2) == x + y
37423742
37433743
3744- def test_division_poly_mpoly ():
3745- """Test that division is consistent across different poly/mpoly types."""
3744+ # def test_division_poly_mpoly():
3745+ # """Test that division is consistent across different poly/mpoly types."""
37463746
3747- Z = flint .fmpz
3747+ # Z = flint.fmpz
37483748
3749- for P , S , [x , y ], is_field , characteristic in _all_polys_mpolys ():
3749+ # for P, S, [x, y], is_field, characteristic in _all_polys_mpolys():
37503750
3751- if characteristic != 0 and not characteristic .is_prime ():
3752- # nmod_poly crashes for many operations with non-prime modulus
3753- # https://github.com/flintlib/python-flint/issues/124
3754- # so we can't even test it...
3755- nmod_poly_will_crash = type (x ) is flint .nmod_poly
3756- if nmod_poly_will_crash :
3757- continue
3751+ # if characteristic != 0 and not characteristic.is_prime():
3752+ # # nmod_poly crashes for many operations with non-prime modulus
3753+ # # https://github.com/flintlib/python-flint/issues/124
3754+ # # so we can't even test it...
3755+ # nmod_poly_will_crash = type(x) is flint.nmod_poly
3756+ # if nmod_poly_will_crash:
3757+ # continue
37583758
3759- one = x ** 0 # 1 as a polynomial
3760- two = one + one
3759+ # one = x**0 # 1 as a polynomial
3760+ # two = one + one
37613761
3762- if is_field or characteristic == 0 :
3763- assert x / x == x ** 0 == 1 == one
3764- assert x / 1 == x / S (1 ) == x / one == x ** 1 == x
3765- assert 1 / one == one ** - 1 == one ** Z (- 1 ) == 1 , type (one )
3766- assert - 1 / one == 1 / - one == (- one )** - 1 == (- one )** Z (- 1 ) == - one == - 1
3767- assert (- one ) ** - 2 == (- one )** Z (- 2 ) == one
3768- assert raises (lambda : 1 / x , DomainError )
3769- assert raises (lambda : x ** - 1 , DomainError )
3762+ # if is_field or characteristic == 0:
3763+ # assert x / x == x**0 == 1 == one
3764+ # assert x / 1 == x / S(1) == x / one == x**1 == x
3765+ # assert 1 / one == one**-1 == one**Z(-1) == 1, type(one)
3766+ # assert -1 / one == 1 / -one == (-one)**-1 == (-one)**Z(-1) == -one == -1
3767+ # assert (-one) ** -2 == (-one)**Z(-2) == one
3768+ # assert raises(lambda: 1 / x, DomainError)
3769+ # assert raises(lambda: x ** -1, DomainError)
37703770
3771- if is_field :
3772- half = S (1 )/ 2 * one # 1/2 as a polynomial
3773- assert half == S (1 )/ 2
3774- assert x / half == 2 * x
3775- assert 1 / half == S (1 ) / half == one / half == one / (S (1 )/ 2 ) == 2
3776- assert half ** - 1 == half ** Z (- 1 ) == 2
3777- assert two ** - 1 == two ** Z (- 1 ) == half
3778- elif characteristic == 0 :
3779- assert raises (lambda : x / 2 , DomainError )
3780- assert raises (lambda : x / two , DomainError ), characteristic
3781- assert raises (lambda : two ** - 1 , DomainError )
3782- assert raises (lambda : two ** Z (- 1 ), DomainError )
3783- else :
3784- # Non-prime modulus...
3785- # nmod can crash and fmpz_mod_poly won't crash but has awkward
3786- # behaviour under division.
3787- pass
3771+ # if is_field:
3772+ # half = S(1)/2 * one # 1/2 as a polynomial
3773+ # assert half == S(1)/2
3774+ # assert x / half == 2*x
3775+ # assert 1 / half == S(1) / half == one / half == one / (S(1)/2) == 2
3776+ # assert half ** -1 == half ** Z(-1) == 2
3777+ # assert two ** -1 == two ** Z(-1) == half
3778+ # elif characteristic == 0:
3779+ # assert raises(lambda: x / 2, DomainError)
3780+ # assert raises(lambda: x / two, DomainError), characteristic
3781+ # assert raises(lambda: two ** -1, DomainError)
3782+ # assert raises(lambda: two ** Z(-1), DomainError)
3783+ # else:
3784+ # # Non-prime modulus...
3785+ # # nmod can crash and fmpz_mod_poly won't crash but has awkward
3786+ # # behaviour under division.
3787+ # pass
37883788
37893789
37903790def _all_matrices ():
@@ -4883,7 +4883,7 @@ def test_use_fmpz_is_probabprime():
48834883
48844884 # test_properties_poly_mpoly,
48854885 # test_factor_poly_mpoly,
4886- test_division_poly_mpoly ,
4886+ # test_division_poly_mpoly,
48874887
48884888 # _test_polys,
48894889 test_mpolys ,
0 commit comments