Re: Adding a positive number and a negative number

2009-01-30 Thread John Machin
On Jan 31, 4:10 am, Scott David Daniels wrote: > Grant Edwards wrote: > > On 2009-01-30, MRAB wrote: > >> Eric Kang wrote: > >>> In two's complement representation, can adding one positive > >>> and one negative give you overflow? > >> No. > > AFAIK, in Python adding integers never gives you over

Re: Adding a positive number and a negative number

2009-01-30 Thread Steve Holden
Scott David Daniels wrote: > Grant Edwards wrote: >> On 2009-01-30, MRAB wrote: >>> Eric Kang wrote: In two's complement representation, can adding one positive and one negative give you overflow? >>> No. >> AFAIK, in Python adding integers never gives you overlow >> regardless of sign.

Re: Adding a positive number and a negative number

2009-01-30 Thread Scott David Daniels
Grant Edwards wrote: On 2009-01-30, MRAB wrote: Eric Kang wrote: In two's complement representation, can adding one positive and one negative give you overflow? No. AFAIK, in Python adding integers never gives you overlow regardless of sign. Right, but he wants his homework answer. -- http

Re: Adding a positive number and a negative number

2009-01-30 Thread Grant Edwards
On 2009-01-30, MRAB wrote: > Eric Kang wrote: > >> In two's complement representation, can adding one positive >> and one negative give you overflow? >> > No. AFAIK, in Python adding integers never gives you overlow regardless of sign. -- Grant Edwards grante Yow!

Re: Adding a positive number and a negative number

2009-01-30 Thread MRAB
Eric Kang wrote: In two’s complement representation, can adding one positive and one negative give you overflow? > No. -- http://mail.python.org/mailman/listinfo/python-list