This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Constant folding

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

0