On 9/8/10 7:12 PM, mda_ wrote:
sage: is_even(e)
TypeError: unsupported operand type(s) for %:
'sage.symbolic.constants_c.E' and 'int'
sage: is_even(float(e))
False
Interesting. The problem seems to be here:
sage: e%2
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
/Applications/Sage-sage-4.5.2-OSX-64bit-10.6-i386-Darwin-app.app/Contents/Resources/sage/<ipython
console> in <module>()
/Users/grout/sage/local/lib/python2.6/site-packages/sage/rings/integer.so in
sage.rings.integer.Integer.__mod__ (sage/rings/integer.c:16342)()
/Users/grout/sage/local/lib/python2.6/site-packages/sage/rings/integer.so in
sage.rings.integer.integer (sage/rings/integer.c:30893)()
/Users/grout/sage/local/lib/python2.6/site-packages/sage/rings/integer.so in
sage.rings.integer.Integer.__init__ (sage/rings/integer.c:6425)()
/Users/grout/sage/local/lib/python2.6/site-packages/sage/symbolic/expression.so
in sage.symbolic.expression.Expression._integer_
(sage/symbolic/expression.cpp:4034)()
TypeError: unable to convert x (=e) to an integer
I think that e not handling modulus should be filed as a trac ticket.
Note that fmod works:
sage: math.fmod(e,2)
0.71828182845904509
Thanks,
Jason
--
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org