[R] 0^0 computation in R : Why it is defined 1 in R ?

ritwik_r at isical.ac.in ritwik_r at isical.ac.in
Mon May 26 14:16:21 CEST 2014


Dear R helpers,


today I found something interesting in R. 0^0 gives value 1 in R. But it
is undefined in mathematics. During debugging a R code, I found it and it
effects my program severely. So my question is why it is defined 1 in R?
Is there any particular reason or its a bug in the R software?

Here is one demo:

*************************************************

ff=function(u){
  return( x^0 * u)
}

x=0
zz=integrate(ff,lower=0,upper=1)$value
zz



> source('~/.active-rstudio-document')
> zz
[1] 0.5
>

*************************************************

Looking forward to hear any response.

Regards,

Ritwik Bhattacharya
Indian Statistical Institute Kolkata



More information about the R-help mailing list