2 ms·
I think you might have missed something in the OP. I got the impression that the "+ 0.1" was enough to raise the value of the floating point number being opera
by mturmon 15y ago
I think you might have missed something in the OP.
I got the impression that the "+ 0.1" was enough to raise the value of the floating point number being operated on, so that it was not denormalized.
So, the "+ 0.1" version was faster because the numbers it generated were not denormalized. It had nothing to do with the special properties of 0 versus 0.1f (a float).
Neither of the two explanations on the SO post made any assumption about the "theoretical optimizing compiler" that you mention, right?