One question: if 3/1 is not prime but ZZ(3/1) is, shouldn't 3/1 == ZZ(3/1) return False? (I don't know how does sage evaluate == , is it documented? I searched for "==" in the docs and got nothing, and "equivalence" gives a super long list.)
El miércoles, 28 de marzo de 2018, 9:02:41 (UTC-3), John Cremona escribió: > > I agree with both Marc's last 2 suggestions. If the global function > is_prime() is called on an integer (even of type Rational) it should do the > natural thing. Anything else raises an error with a helpful message that > x.is_prime() might be what is wanted. > > On Wed, 28 Mar 2018, 12:19 Marc Mezzarobba, <ma...@mezzarobba.net > <javascript:>> wrote: > >> Dima Pasechnik wrote: >> > is_prime() should be restricted to rings in which one can have >> > non-trivial prime elements >> >> Well, that's what I'm doubting. If the goal is that the global >> is_prime() function doesn't do anything surprising for people who would >> have integers in mind, then it may be better to restrict it to plain >> integers. >> >> >> >> >> -- >> Marc >> >> -- >> You received this message because you are subscribed to the Google Groups >> "sage-devel" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to sage-devel+...@googlegroups.com <javascript:>. >> To post to this group, send email to sage-...@googlegroups.com >> <javascript:>. >> Visit this group at https://groups.google.com/group/sage-devel. >> For more options, visit https://groups.google.com/d/optout. >> > -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+unsubscr...@googlegroups.com. To post to this group, send email to sage-devel@googlegroups.com. Visit this group at https://groups.google.com/group/sage-devel. For more options, visit https://groups.google.com/d/optout.