I think the parent of the answer is not really the problem, but the actual 
code producing the answer:

sage: R = GaussianIntegers()

sage: R(*10*)//*7*

10/7


I agree with Jeroen his comment made on the trac ticket:

> Well, the correct behaviour would be to do the right thing in the 
> imaginary quadratic orders which are naturally Euclidean and raise an 
> exception otherwise


 
On Friday, 6 October 2017 04:41:20 UTC+2, David Roe wrote:
>
> As pointed out in #23971, the following is unexpected if you're used to 
> floor division in Z:
>
> sage: R = GaussianIntegers()
> sage: (R(1)//1).parent()
> Number Field in I with defining polynomial x^2 + 1
>
> For Gaussian integers, we can do better: there is a reasonable quo_rem 
> algorithm and R is norm-Euclidean.  But it's not clear to me what the right 
> thing to implement is, since most orders are not norm-Euclidean, and it 
> would be strange to have the meaning of floor division vary by number field.
>
> Any thoughts?  I do think that there is an expectation in Sage that the 
> parent of a//b is the same as the common parent of a and b, while a/b 
> changes the parent to the fraction field.
> David
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-nt" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send an email to [email protected].
Visit this group at https://groups.google.com/group/sage-nt.
For more options, visit https://groups.google.com/d/optout.

Reply via email to