On Fri, Apr 24, 2009 at 9:03 AM, Robert Miller <rlmills...@gmail.com> wrote:
>
> sage: x = polygen(ZZ)
> sage: f = 2*x^2
> sage: f.mod(2)==0
> False

You should do "f.mod?" and read the docstring, which says:

"Return a representative for self modulo the ideal I (or the ideal
  generated by the elements of I if I is not an ideal.)"

I believe f itself is a representative for f mod the ideal 2.  :-)

You're assuming that the mod function does something interesting, but
it is in this case just some generic code which does what its
definition says, which in this case happens to be nothing.

So make it better! :-)

William


> sage: type(f.mod(2))
> <type
> 'sage.rings.polynomial.polynomial_integer_dense_flint.Polynomial_integer_dense_flint'>
>
> Even this doesn't work:
> sage: R.<x> = ZZ[]
> sage: f.mod(2*R)==0
> False
>
> But last I checked, 2 | 2x^2.
> >
>



-- 
William Stein
Associate Professor of Mathematics
University of Washington
http://wstein.org

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-devel@googlegroups.com
To unsubscribe from this group, send email to 
sage-devel-unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to