On Wednesday, May 25, 2016 at 7:55:46 AM UTC+3, Kalevi Suominen wrote: > > > > On Wednesday, May 25, 2016 at 3:31:23 AM UTC+3, Phillip M. Feldman wrote: >> >> I tried the following: >> >> In [1]: from sympy import * >> In [2]: R, x= ring('x', GF(2)) >> In [3]: p= x**5 + 1 >> In [4]: q= x+1 >> In [5]: div(p, q) >> >> The result is an exception: SympifyError: x**5 + 1 mod 2 >> >> Any advice will be appreciated. >> > > div(p, q) is intended for expressions. p and q are polynomials, not > expressions. Division of polynomials is defined as a method: > In [4]: p.div(q) > Out[4]: (x**4 + x**3 + x**2 + x + 1 mod 2, 0 mod 2) >
PS: You can also write p/q, if the remainder 0 is not needed. -- You received this message because you are subscribed to the Google Groups "sympy" group. To unsubscribe from this group and stop receiving emails from it, send an email to sympy+unsubscr...@googlegroups.com. To post to this group, send email to sympy@googlegroups.com. Visit this group at https://groups.google.com/group/sympy. To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/09fe327e-be5b-4f4c-947c-2b127cd0bd9d%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.