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 <wst...@gmail.com> wrote: > > On Sat, Jan 1, 2022 at 4:01 PM Michael Beeson <profbee...@gmail.com> 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, we probably should have just made is_prime throw an > exception if the parent ring is a field, since the ring theory > definition of prime number isn't very useful in a field. > > > > > 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 > > "sage-support" group. > > To unsubscribe from this group and stop receiving emails from it, send an > > email to sage-support+unsubscr...@googlegroups.com. > > To view this discussion on the web visit > > https://groups.google.com/d/msgid/sage-support/9cb13872-298c-4463-b27d-b77ea288bfedn%40googlegroups.com. > > > > -- > William (http://wstein.org) -- William (http://wstein.org) -- You received this message because you are subscribed to the Google Groups "sage-support" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-support+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/sage-support/CACLE5GDVrKCa8-SCn-2p22oXDyQgtnS6s26upXCA-z%2Bx9EZAuw%40mail.gmail.com.