prime_number = bignumber / 2
is_prime(prime_number) # -> False

prime_number = bignumber // 2
is_prime(prime_number) # -> True

prime_number = ZZ(bignumber / 2)
is_prime(prime_number) # -> True


I've spent a couple of days arguing with people about a number (not) being 
a prime. Turns out it fails silently if you're in the wrong field.

I guess a fix would be to ZZ() the number first in the function is_prime. 
If you guys agree I can submit a patch or something (never touched at 
Sage's codebase and that would be a good opportunity)

David

-- 
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.

Reply via email to