More here:
https://doc.sagemath.org/html/en/reference/structure/sage/structure/element.html#sage.structure.element.RingElement.is_prime
On Sat, Jan 1, 2022 at 4:27 PM William Stein wrote:
>
> On Sat, Jan 1, 2022 at 4:01 PM Michael Beeson wrote:
> >
> > sage: d = 6
> >
> > sage: p = d/2
> >
> >
On Sat, Jan 1, 2022 at 4:01 PM Michael Beeson wrote:
>
> sage: d = 6
>
> sage: p = d/2
>
> sage: p
>
> 3
>
> sage: is_prime(p)
>
> False # Huh?!!
The parent of p is QQ (the rational field).
p is not a prime number of the **rational field**.
You should coerce p to ZZ first.
In retrospect, w
sage: d = *6*
sage: p = d/*2*
sage: p
3
sage: is_prime(p)
False # Huh?!!
sage: is_prime(*3*)
True
sage: p==*3*
True
This happens in version 8.7 and also in the current version (installed
yesterday)
--
You received this message because you are subscribed to the Google Groups