a signed integer can of course hold +/- 32768. 'result' should be 52 and should fit just fine. However i keep getting strange math errors in equations like this and i think it is because the (200 * 8 * 33) part if it results in 52800 which is too big to fit in the integer.
So my questions are, is my thinking correct? Is all of the intermediate arithmetic as it crunches stored in a register the same size as the data type that it will eventually be assigned to?
And how do i get around this? If i do like (200 * 8)/1000 * 33 or (200 * 33)/1000 * 8 my rounding error grows too high.
Do i just need to use a long even though i'm only storing a max of 52?
Is all of the intermediate arithmetic as it crunches stored in a register the same size as the data type that it will eventually be assigned to?
No. The intermediate results are stored in a register that is the size of the largest data value involved. Since all the values are ints, an int register is used. 52,800 will not fit in an int.
You can change the register size by casting or by adding L or UL to the end of one or more of the values.
To be precise, 52,800 is an integer. It just won't fit into an integer variable.
That isn't precise at all.
It won't fit into an "int" variable on any Arduino except the Due.
However, don't confuse "int" with "integer" long myVar = 52800;