Wait a minute...

Look at a simple case,

(this is binary folks)
a = 1 1 1 1

b = 0 1 1 1

if (a & b & 0x8) { ... } would be false, but the addition of a and b would
result in a carry (overflow).

or this case:

a = 1 0 0 0
b = 1 0 0 0

if (a & b & 0x8) {...} would be true, but the addition of a and b would
still result in a carry (overflow).

Maybe I'm just too tired to see straight.

Ed
----- Original Message -----
From: "Philip Sheard" <[EMAIL PROTECTED]>
To: "Palm Developer Forum" <[EMAIL PROTECTED]>
Sent: Tuesday, November 28, 2000 10:32 PM
Subject: Re: a very naive question...


> if (a & b & 0x80000000){...
>
> ----- Original Message -----
> From: "Paul Nevai" <[EMAIL PROTECTED]>
> To: "Palm Developer Forum" <[EMAIL PROTECTED]>
> Sent: Tuesday, November 28, 2000 7:40 PM
> Subject: a very naive question...
>
>
> > Suppose I use C in CW and I have
> >
> > UInt32 a, b;
> >
> > How can I determine if "a" and "b" are "huge" then (a + b) is not beyond
> > 0xFFFFFFFFF [max UInt32]?
> >
> > Is there a standard way of doing it?
> >
> > E.g, can I check if (a + b < a || a + b < b)? Does this make sense? Does
> my
> > question make sense?
> >
> > Best regards, Paul
> >

> > --
> > For information on using the Palm Developer Forums, or to unsubscribe,
> please see http://www.palmos.com/dev/tech/support/forums/
> >
>
>
> --
> For information on using the Palm Developer Forums, or to unsubscribe,
please see http://www.palmos.com/dev/tech/support/forums/
>


-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/tech/support/forums/

Reply via email to