title: Why does exponentiation (e.g., 10^6) take 4 times longer than calculator notation (e.g., 1e6) in R?
body: <p>Using the scientific notation <code>10^6</code> in an R code (as I customarily do) results in a significantly longer computing time than using the calculator representation <code>1e6</code>:</p>
  
  <pre><code>&gt; system.time(for (t in 1:1e7) x=10^6) 
    utilisateur     système      écoulé 
          4.792       0.000       4.281 
  &gt; system.time(for (t in 1:1e7) x=1e6) 
   utilisateur     système      écoulé 
         0.804       0.000       1.051
  &gt; system.time(for (t in 1:1e7) x=exp(6*log(10)))
   utilisateur     système      écoulé 
         6.301       0.000       5.702
  </code></pre>
  
  <p>Why is it the case that R recomputes <code>10^6</code> in about the same times as it computes <code>exp{6*log(10)}</code>? I understand the fact that R executes a function when computing <code>10^6</code>, but why was it coded this way?</p>