Quote:
Originally Posted by RyanN
It will not try to use floating point or just use that fraction and multiply it? I thought that would work.
|
As already mentioned, integers do integer method. In order to maintain precision with integer math, you want to do division with the largest numbers possible. Division will always loose precision.
What was shown will work, but you might even get a little better precision by doing...
wrist_pos = (-11*arm_pos + 1670*5) / 5;
This maximizes the numerator before dividing by the denominator.