Integer math question
swalters_usenet at yahoo.com
Mon Jan 5 18:55:33 CET 2004
|Thus Spake Sean Ross On the now historical date of Sat, 03 Jan 2004
> I think you're supposed to do something like this a = bq + r, 0<= r <
It is, indeed, 0 <= r < abs(b)
"If a and b are integers such that b != 0, then there exist unique
integers r and q such that a = q*b + r and 0 <= r < abs(b)"
For non-mathematical spectators, the divmod() function is defined so that
q, r = divmod(a, b) by the definition above.
Never forget the halloween documents.
""" Where will Microsoft try to drag you today?
Do you really want to go there?"""
More information about the Python-list