[algogeeks] Re: the sum of two unsigned integers

2007-02-06 Thread Lego Haryanto
Have you tested that expression and ever see an overflow printed out? On 2/6/07, pramod negi <[EMAIL PROTECTED]> wrote: > > > > > > > > i think > > > to check whethere the result is overflowed or not > > check if ((A+B) -A is not equal to B) >printf("Overflow"); > > > correct in

[algogeeks] Re: the sum of two unsigned integers

2007-02-06 Thread pramod negi
> > > > i think to check whethere the result is overflowed or not check if ((A+B) -A is not equal to B) printf("Overflow"); correct in if i m wrong --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google

[algogeeks] Re: the sum of two unsigned integers

2007-01-24 Thread luhong
You got it, praveen. On Jan 24, 7:07 pm, "praveen Jain" <[EMAIL PROTECTED]> wrote: > sorry my previous mail was incomplete > > according to my thinking this could be the solution. > take the summation of both the element and compare it with either of the > element if it is more then overflow won'

[algogeeks] Re: the sum of two unsigned integers

2007-01-24 Thread praveen Jain
sorry my previous mail was incomplete according to my thinking this could be the solution. take the summation of both the element and compare it with either of the element if it is more then overflow won't happen. if it is less it means oveflow has happened. Regards Praveen On 1/25/07, pravee

[algogeeks] Re: the sum of two unsigned integers

2007-01-24 Thread praveen Jain
hi abid , I think this could be the solution. if u take the summation of both the element and co On 1/24/07, Abid <[EMAIL PROTECTED]> wrote: > > > This is an interview question. > What is the simples way to check if the sum of two unsigned integers > has resulted in an overflow. ? >

[algogeeks] Re: Fwd: [algogeeks] Re: the sum of two unsigned integers

2007-01-24 Thread Lego Haryanto
*Santhosh Suresh > *Sent:* Wednesday, January 24, 2007 8:02 AM > *To:* algogeeks@googlegroups.com > *Subject:* [algogeeks] Fwd: [algogeeks] Re: the sum of two unsigned > integers > > > > > say, given the limit of the unsigned as k bits. Find log to base 2^k. If > i

[algogeeks] Re: Fwd: [algogeeks] Re: the sum of two unsigned integers

2007-01-24 Thread Ming \(Amos\) Zhang
: [algogeeks] Fwd: [algogeeks] Re: the sum of two unsigned integers say, given the limit of the unsigned as k bits. Find log to base 2^k. If it's one in both, it'll result in an overflow. -- Forwarded message -- From: aravind kumar <[EMAIL PROTECTED]> Date: Jan 24, 2007

[algogeeks] Fwd: [algogeeks] Re: the sum of two unsigned integers

2007-01-24 Thread Santhosh Suresh
say, given the limit of the unsigned as k bits. Find log to base 2^k. If it's one in both, it'll result in an overflow. -- Forwarded message -- From: aravind kumar <[EMAIL PROTECTED]> Date: Jan 24, 2007 7:10 PM Subject: [algogeeks] Re: the sum of two unsi

[algogeeks] Re: the sum of two unsigned integers

2007-01-24 Thread aravind kumar
check if the sum is less than any of the two numbers that means the sum resulted in a overflow. On 1/24/07, Abid <[EMAIL PROTECTED]> wrote: > > > This is an interview question. > What is the simples way to check if the sum of two unsigned integers > has resulted in an overflow. ? > > > > > -- R