Hi,

First of all, many thanks to all the Sage development folks. We have a
great time in my team using Sage for our research work.

I just wanted to present you with a little problem.

With the following code:
from sage.symbolic.expression_conversions import polynomial
var('x')
expression = 4/x # Or any value different from 1.
print "Is expression a polynomial? ",
expression.is_polynomial(expression.arguments()[0])

We get:
Is expression a polynomial?  True

But if we change "expression = 4/x" to "expression = 1/x" then I get:
Is expression a polynomial?  False

If we try to convert these expressions into a
sage.rings.polynomial.polynomial_real_mpfr_dense.PolynomialRealDense
with "polynomial(expression, RR)", in both cases I get an error:
TypeError: denominator must be a unit

We went around what is problem for us with this (insatisfactory) hack:
print "Is expression a polynomial? ", \
bool(expression.is_polynomial(expression.arguments()[0]) and
(expression.denominator().diff() == 0))

We have this same behaviour on 4.6, 4.61, 4.62 (I have unfortunately
not access to previous Sage versions) Linux for Unbuntu precompiled
packages used on Ubuntu 10.04 LTS x86, Debian Lenny and Squeeze amd_64
distributions.

Two things puzzle us:
- why should 4/x (or whatever_different_from_1/x) be considered as a
polynomial?
- if 4/x should why 1/x should not?

I have this same behaviour on 4.6, 4.61, 4.61 (I have unfortunately
not access to previous Sage versions) on Linux for Unbuntu precompiled
package used on Ubuntu 10.04 LTS x86, Debian Lenny and Squeeze amd_64
distributions.

Thanks in advance.

Best regards,

Serge Torres

-- 
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

Reply via email to