On Apr 28, 2010, at 6:04 AM, Yann wrote:
This at least documented:sage: R.<x>=ZZ[] sage: f = x^3+x+1 sage: f.mod? ... When little is implemented about a given ring, then mod may return simply return f. For example, reduction is not implemented for ZZ[x] yet. (TODO!) sage: R.<x> = PolynomialRing(ZZ) sage: f = x^3 + x + 1 sage: f.mod(x + 1) x^3 + x + 1
Ouch. We should be at least trying f % q, or even f.quo_rem()[1], which is much better implemented across the board. (I didn't even know there was a mod method.)
- Robert
On Apr 28, 2:03 pm, Michael Rybalkin <[email protected]> wrote:I faced with a problem with polynomial mod This is example from manual: mod? sage: R.<x> = QQ['x']; sage: f = x^3 + x + 1 sage: f.mod(x + 1) Result is -1 But changing from field QQ to ring ZZ causes mod to do nothing: sage: R.<x> = ZZ['x']; sage: f = x^3 + x + 1 sage: f.mod(x + 1) Result is x^3 + x + 1 Mod function doesn't do anything. And is doesn't work for polynomials over IntegerModRing also and for symbolic polynomial ring. sage: var('x') sage: f = x^3 + x + 1 sage: f.mod(x + 1) Result is x^3 + x + 1 -- To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group athttp://groups.google.com/group/sage-support URL:http://www.sagemath.org-- To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org
-- To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org
