Hi, How to detect arithmetic overflow/underflow in C and C++?
For example, if I do something like this: unsigned i = 0; i--; Whats a good way to detect/catch/trap the underflow? Right now I do something like: unsigned iPrev = i; i--; if (iPrev<i) return MYERROR_UNDERFLOW; Cheers, Vishal -- "Thou shalt not follow the null pointer for at its end madness and chaos lie." -- ______________________________________________________________________ Pune GNU/Linux Users Group Mailing List: ([EMAIL PROTECTED]) List Information: http://plug.org.in/mailing-list/listinfo/plug-mail Send 'help' to [EMAIL PROTECTED] for mailing instructions.
