[sage-devel] Re: issue with division in fraction field of univ poly

2023-07-02 Thread 'Travis Scrimshaw' via sage-devel
When I first tried Ben's OP code, it worked as there. Then when trying Nil's code, I get the same output as Ben, but when I immediate after run sage: D2 / D1 ...Same traceback as above... ZeroDivisionError: fraction field element division by zero Now in a fresh Sage session, I immediately get

[sage-devel] Re: issue with division in fraction field of univ poly

2023-06-27 Thread Ben Hutz
I'm not getting 0 with that code: sage: K. = Frac(QQ['a']) sage: P. = ProjectiveSpace(K, 1) sage: D2=-x^5 + (-3*a^2 + 7*a - 2)/a*x^4*y + (6*a^2 - 12*a + 4)/a*x^3*y^2 + (3*a^4 - 19*a^3 + 29*a^2 - 14*a + 2)/(a^2)*x^2*y^3 + (-8*a^4 + 30*a^3 - 37*a^2 + 18*a - 3)/(a^2)*x*y^4 + (4*a^4 - 12*a^3 +

[sage-devel] Re: issue with division in fraction field of univ poly

2023-06-26 Thread Nils Bruin
With your data, we get: sage: K=parent(1/D2) sage: r=K(D1) sage: s=K(1/D2) sage: r.numerator().gcd(s.denominator()) 0 and I think that's the zero which leads to the division-by-zero error. Of course, a 0 returned as gcd is just a bug. It doesn't look like the coercion framework is really