[Python-Dev] Re: Ye don't be needin' these!
Robert Kern
rkern at ucsd.edu
Wed Mar 23 17:04:07 CET 2005
Herman Toothrot wrote:
> Avast! Why be there builtins divmod and pow, when operators **, /, and
> % should be good enough for ya? It runs counter to TOOWTDI, I be
> thinking. Arr.
Well, divmod(x, y) does both / and % in one shot, which can be very
useful. pow(x, y[, z]) has an optional third argument ((x**y) % z),
which is necessary for really large numbers like the ones you play with
in cryptography.
--
Robert Kern
rkern at ucsd.edu
"In the fields of hell where the grass grows high
Are the graves of dreams allowed to die."
-- Richard Harter
More information about the Python-Dev
mailing list