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.Sun, 20 Jul 2014 12:39:29 +0200"divides" in ring of integershttps://ask.sagemath.org/question/23498/divides-in-ring-of-integers/ It seems the method for "divides" is inherited to a ring_of_integers, but has undesirable behaviour:
f = CyclotomicField(3)
r = f.ring_of_integers()
gens = r.gens()
x = 1 + gens[1]
r(x).divides(r(gens[1]))
returns "True". Have I overlooked something here?
Sun, 20 Jul 2014 11:57:57 +0200https://ask.sagemath.org/question/23498/divides-in-ring-of-integers/Answer by Luca for <p>It seems the method for "divides" is inherited to a ring_of_integers, but has undesirable behaviour:</p>
<pre><code>f = CyclotomicField(3)
r = f.ring_of_integers()
gens = r.gens()
x = 1 + gens[1]
r(x).divides(r(gens[1]))
</code></pre>
<p>returns "True". Have I overlooked something here?</p>
https://ask.sagemath.org/question/23498/divides-in-ring-of-integers/?answer=23499#post-id-23499 With your input,
( r(gens[1]) / r(x) ).is_integral()
returns `True`. So, no, I see no problem here. However
sage: f = CyclotomicField(3)
sage: r.<z> = f.ring_of_integers()
sage: r(2).divides(z)
True
sage: (z/2).is_integral()
False
which is fishy.
Sun, 20 Jul 2014 12:39:29 +0200https://ask.sagemath.org/question/23498/divides-in-ring-of-integers/?answer=23499#post-id-23499