On Fri, 2 Jul 2010 05:18:00 am Eike Welk wrote:

> As you are using long integers (and you were previously writing about
> prime numbers) the precision of floating point numbers might not be
> enough for your purposes.

It certainly won't be once you get to large enough primes!

> Therefore you should probably use the integer division operator: "//"

And the reminder (or modulo) operator %, together with the combination 
function divmod(a, b) which returns (a//b, a%b). The advantage of 
divmod is that it is faster than calling a//b followed by a%b.


-- 
Steven D'Aprano
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to