How about:
if ( a > ( (UInt32)(0xFFFFFFFF-b) ) ) {
//Overflow
} else {
//OK
}
-- Tim
Paul Nevai wrote:
> 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/