Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

3
  • 2
    @minitech: That's such a bad test. All the code in the test is constant. Before the code is even JITed, it'll eliminate all the constants. Commented Jan 27, 2014 at 3:44
  • @M28: I was pretty sure jsPerf’s internals (i.e. eval) made that happen afresh each time. Regardless, yes, it is a pretty bad test, because it’s a very silly optimization. Commented Jan 27, 2014 at 4:10
  • Isn't the OP asking specifically about dividing by 2? Where could a divide by 0 come up? Commented Mar 5, 2023 at 5:06