On 11/13/2012 02:07 AM, P Purkayastha wrote:
On 11/13/2012 01:06 AM, Ben Hutz wrote:
The following works

sage: R.<t>=PolynomialRing(QQ)
sage: S.<x>=PolynomialRing(R)
sage: x/S(2)
x/2

The following does not

sage: R.<t>=PolynomialRing(QQ)
sage: S.<x,y>=PolynomialRing(R)
sage: x/S(2)
Traceback (most recent call last):
...
AttributeError: 'int' object has no attribute 'parent'

Seems to me that if the first one works, then so should the second. I
searched the trac server and couldn't come up with anything on this.

Thanks,
Ben

There is a simple fix for this (I hope).


--- a/sage/rings/polynomial/multi_polynomial_element.py
+++ b/sage/rings/polynomial/multi_polynomial_element.py
@@ -280,7 +280,7 @@
53 bits of precision
"""
if right in self.base_ring():
- inv = 1/self.base_ring()(right)
+ inv = self.base_ring()(1)/self.base_ring()(right)
return inv*self
return self.parent().fraction_field()(self, right, coerce=False)


If it looks right, then I can try and open a ticket.



Oh. by the way, the command works after applying this ppatch:

sage: sage: R.<t>=PolynomialRing(QQ)
sage: sage: S.<x,y>=PolynomialRing(R)
sage: sage: x/S(2)
1/2*x


--
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
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.
Visit this group at http://groups.google.com/group/sage-devel?hl=en.


Reply via email to