Comment on Stanford's CS 101 course uses JavascriptparentComments−bzbarsky15yFor integers only. For floats, a compiler will typically only do strength-reduction if you ask it to explicitly, because it changes the answer, so it technically an invalid optimization.
Comments
For integers only. For floats, a compiler will typically only do strength-reduction if you ask it to explicitly, because it changes the answer, so it technically an invalid optimization.