On 2015-03-09 12:04, Jori Mantysalo wrote:
When has this changed? Why?

I changed this in http://trac.sagemath.org/ticket/17538

The main motivation was to have an is_prime() method for elements of the ring of integers of a number field, such as ZZ[sqrt(-1)]. Since primality checking of ideals for such rings was already implemented, it made sense to define is_prime() also for elements.

For number field elements, is_prime() *does* look at ring of integers:

sage: Q.<u> = NumberField(x)
sage: Q
Number Field in u with defining polynomial x
sage: Q(2).is_prime()
True
sage: QQ(2).is_prime()
False

This is because of

sage: Q.ideal(2)
Fractional ideal (2)
sage: QQ.ideal(2)
Principal ideal (1) of Rational Field

Honestly, I don't know the best way to fix all this.

--
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.

Reply via email to