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
>
>
>
> 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
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'
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
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. ?
>
*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] 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
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
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