To cycle a value between -1 to +1, for an saw lfo or something you could go:
X += 0.01;
if (X > 1) {X -= 2;}
I suppose you could use modulus or something to avoid the if, but can you do that with floats? Would:
X += 0.01;
X = X % 2;
X -= 1;
render the same result?
And what about something like this:
X += 0.01;
X = X - ((X & 1) * 2);
The and expression should only return true if X is equal to or larger than 1.
And which is most efficient?