Does the order of multiplication variables of different data type cause different results?

Viewed 1281

Lets say I have 3 variables: a long, an int and a short.

long  l; 
int   i;
short s;
long  lsum;

If this is a pure math, since multiplication has a commutative property, the order of these variables doesn't matter.

 l * i * s = i * s * l = s * i * l.

Let lsum be the container of the multiplication of these 3 variables.

In C, would there be a case where a particular order of these variables cause different result?

If there is a case where the order does matter, not necessarily from this example, what would that be?

2 Answers
Related