I was just wondering is there any efficiency / other reasons to use one or the other in the following two examples:
Example A:
angle= (angle+ diff) % 360;angle= angle< 0 ? angle= 360+angle: angle;
Example B:
float angleTemp = angle+diff;if(angleTemp >= 360){ angleTemp -= 360;}if(angleTemp < 0) { angleTemp += 360; }angle = angleTemp;
The modulator approach only just occurred to me and I was wondering whether it would be more or less efficient. Especially as some people would consider Example A less readable. My initial thought is that the difference would be more or less negligible but I thought i'd pose the question and find out.
-Thanks Chris