ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Wed, 04 Mar 2020 11:05:37 +0100given an euclidean domain get the euclidean functionhttps://ask.sagemath.org/question/50151/given-an-euclidean-domain-get-the-euclidean-function/ I am writing a polymorphic function that implements an algorithm that should work in all euclidean domains. My function should work in all euclidean domains, even ones that have not been implemented yet. My algorithm uses the euclidean function. How do I polymorphically get the canonical euclidean function for my particular domain?Tue, 03 Mar 2020 23:49:52 +0100https://ask.sagemath.org/question/50151/given-an-euclidean-domain-get-the-euclidean-function/Answer by rburing for <p>I am writing a polymorphic function that implements an algorithm that should work in all euclidean domains. My function should work in all euclidean domains, even ones that have not been implemented yet. My algorithm uses the euclidean function. How do I polymorphically get the canonical euclidean function for my particular domain?</p>
https://ask.sagemath.org/question/50151/given-an-euclidean-domain-get-the-euclidean-function/?answer=50158#post-id-50158As seen in the [documentation for Euclidean domains](http://doc.sagemath.org/html/en/reference/categories/sage/categories/euclidean_domains.html) the Euclidean function is implemented as a method on elements named `euclidean_degree`:
sage: R.<x> = QQ[]
sage: x.euclidean_degree()
1Wed, 04 Mar 2020 11:05:37 +0100https://ask.sagemath.org/question/50151/given-an-euclidean-domain-get-the-euclidean-function/?answer=50158#post-id-50158