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*

13
  • 1
    @Madura I am sure, because I don't use compilers from the last millennium. Commented Dec 22, 2013 at 13:53
  • 1
    @user567879 The maths: raising to a 1/n-th power is the same as taking the n-th root. That's by definition. In C(++), 1/n is an integer division, whereas in 1./n 1. is a double literal, so n gets converted to a double, and then divides 1. Commented Dec 22, 2013 at 13:55
  • 9
    I'd prefer writing 1.0 / n. It'll save a lot of people who might read the code a few "brain cycles" when they think what does this mean... Commented Dec 22, 2013 at 14:01
  • 5
    @MaduraAnushanga: Why would you compile without -O2 or -O3? It seems obvious that if you compile without optimisations enabled then optimisations will not be performed. Commented Dec 22, 2013 at 14:06
  • 2
    Great benchmarking right there. As Scooter once said: "Statistically these are the safest cars on Pandora. Let me throw some numbers at you... Five! Twenty-three! Eight Hundred and Six!" Commented Dec 22, 2013 at 14:11