On 6 October 2017 at 03:40, David Roe <[email protected]> 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.

You are right that for general orders (even maximal orders) there is
no obvious definition for "the least residue of a mod b" which is
needed here, since the value of a//b "should be" (a-(a mod b))//b.

I am not really bothered by this.  I don't ever use elements with
orders as parents.  I have done a vast number of computations which
start

sage: K.<i>=QuadraticField(-1)

but I don't think I even knew the existence of GaussianIntegers()!
Are there any other orders which have special constructors, apart from
EisensteinIntegers?  These are viewed as special cases where we could
use Euclidean division even if for general orders there is something
else to do (though exactly what is not yet decided).

John

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

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