Thanks for my help guys. Hopefully changing all of my numbers to number.0 will help my Robotic Arm trig be more accurate and get rid of the oddball glitchieness
Also will start separating my math out to separate lines and serial printing the results and double check that it's doing the math like I expect it to.
Read Pete's reply above. If it really was due to there just being too many computations on a single line then it would probably be a different kind of error and error message.
Not the it hurts to limit line length and calculation depth per line. It can make your code easier to read and easier to debug, however I don't think it is the specific reason for the "spurious" results in your case.
If you want full float evaluation of an expression then, at an absolute maximum, all that is needed is at least one operand per binary operator ( '+' , '-' , '*' and particularly '/' ) that is either:
- a float variable
- another numeric variable typecast to float
- a const float
- a literal constant including a decimal point.
If you are totally confident about the precise order in which C evaluates your expression (I'm not, but some are more familiar with this than myself) then you may need less than outlined above. But at least one float per operator will definitely assure a fully float evaluation.