From: | Lee Atkins |
Date: | 12 Dec 99 at 15:05:49 |
Subject: | Overflow |
From: Lee Atkins <lee@loonyjuicesoftware.freeserve.co.uk>
Hello,
Heres a question about C in general.
Say I have some code :-
unsigned char T1, T2, T3;
....
if( ( T1 + ( (T2-T3)*11/4 ) ) > 205)
{
do whatever
}
Am I right in thinking that the fact that T1,T2 and T3 are unsigned chars
doesnt matter if say T3 is bigger than T2.
What size of storage will the compiler use to calculate the expression to compare
to 205? Will there be any problems with the expression over/under flowing?
Hope that makes sense.
Lee.