[Tutor] Arbitrary precision arithmetic

Terry Carroll carroll at tjc.com
Sun Jan 4 22:49:06 EST 2004


On Sun, 4 Jan 2004, Daniel Ehrenberg wrote:

> > "divmod( a, b)
> 
> Yes, I did RTM, but I don't understand it. I should
> have said that before.

It's actually not that mysterious.  divmod dides the numbers and give you 
the result as a two-member tuple in the form integer-and-remainder.

Remember when you learned division in elementary school, and you 
expressed, for example, 10 / 3 as "three, remainder one"?  That's divmod:

>>> divmod(10,3)
(3, 1)
>>>

-- 
Terry Carroll
Santa Clara, CA
carroll at tjc.com 




More information about the Tutor mailing list