HI I'm new to the tread. I found when using V7.06 constant folding does not appear to work the way I would expect. I would expect that both of these expressions would evaluate to the same answer. However case 1 results in 0. Any options, or is this just a bug! -Jim unsigned short value; value = ADC; value *= 10000L/20000L; //case 1 value = value * 10000L/20000L; //case 2
Any options, or is this just a bug! It's a bug in your expectations. The two assignment statements you present aren't really the same. To make the second one equivalent to the first, you'ld have to write
value = value * (10000L/20000L); //case 2