sage: x,y,z = R.gens()
sage: s = ZZ.random_element(1,5).abs()
sage: gs = [ R.random_element() for idx in range(s) ]
- sage: f = R.random_element(ZZ.random_element(10).abs())
+ sage: # hack for SageMath Trac #28855
+ sage: f = R(R.random_element(ZZ.random_element(10).abs()))
sage: (qs, r) = multidiv(f,gs)
sage: r != 0 or f in R.ideal(gs)
True
sage: R = PolynomialRing(QQ, 'x,y,z')
sage: s = ZZ.random_element(1,5).abs()
sage: gs = [ R.random_element() for idx in range(s) ]
- sage: f = R.random_element(ZZ.random_element(10).abs())
+ sage: # hack for SageMath Trac #28855
+ sage: f = R(R.random_element(ZZ.random_element(10).abs()))
sage: (qs, r) = multidiv(f,gs)
sage: r + sum( qs[i]*gs[i] for i in range(len(gs)) ) == f
True
sage: R = PolynomialRing(QQ,'x,y,z')
sage: gs = R.random_element().monomials()
sage: I = R.ideal(gs)
- sage: f = I.random_element(ZZ.random_element(5).abs())
+ sage: # hack for SageMath Trac #28855
+ sage: f = R(I.random_element(ZZ.random_element(5).abs()))
sage: (qs, r) = multidiv(f, gs)
sage: r.is_zero()
True