The compiler can't replace every floating point division with a multiplication with the reciprocal. And it can't assume associativity. See also -ffast-math.
You can do this:
return (double)steps * (2.0 * PI / 4096.0);
The compiler can't replace every floating point division with a multiplication with the reciprocal. And it can't assume associativity. See also -ffast-math.
You can do this:
return (double)steps * (2.0 * PI / 4096.0);