The same can happen for double with different values. You’re just hiding a problem that needs to be solved. The correct way to do this would be to use atan2 which has guaranteed output range. Or clamp the input value for acos. Or refactor the code to not use angles at all (many things can be done in vectors/matrices/etc. alone).
Switching to double gives you false security that it’s fixed but then it will kaboom. And it will be much worse to reproduce the bug as the precision error will get significant enough to trigger the bug after much more time than with floats.
One real example: I was using matrices for accumulating rotation (which is ‘bad’ thing) and the symptoms were pretty interesting: after some time one could notice the near clip plane slowly moved to far side… at first I thought it was something wrong in the projection matrix, but then realized it must come from some input matrices and found it. The solution was easy in my case, just renormalize it after applying incremental rotation to it. If I used doubles the bug would be triggered after longer time and would annoy players who play for few hours instead of 10mins or so and it would be much harder to reproduce for me.
)
:-X :-\
(ok ok sorry kidding but that usually the two argument given by some unaware people…)