In <[EMAIL PROTECTED]>, Hugh wrote: > I would like to perform an addition without carrying of two integers... > I've got no idea how to do this in python, although I've been using it > for web/cgi/db work for a few years now.
Your description is a bit vague. What is `without carrying`? Do you want to limit the result to a given bit length with a "wrap around" behavior if the number gets too large to fit into those bits? Then this should do the trick: a = (b + c) & (2**bits - 1) Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list