On 2015-03-09, John Cremona <john.crem...@gmail.com> wrote:
> In preparing an example for a course I discovered this seriously
> misleading feature:
>
> sage: n=(10^19-1)/9
> sage: n.factor()
> 1111111111111111111
> sage: n.is_prime()
> False
> sage: ZZ(n).is_prime()
> True
>
> What is happening is that when I defined n I used / so that I defined
> a rational number.  And in QQ, there are no primes.
>
> sage: n = (10^19-1)//9
> sage: n.is_prime()
> True
>
> I don't think there is a good solution for this but surely it will
> cause confusion (it confused me for at least 5 minutes).

I don't even see the meaning of QQ(n).factor()
(Prime) factoring in a field is meaningless, IMHO...

Dima

-- 
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 post to this group, send email to sage-support@googlegroups.com.
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