[R] R: to the power

Bernardo Rangel Tura tura at centroin.com.br
Sat Jul 16 11:09:40 CEST 2005


At 10:11 12/7/2005, allan_sta_staff_sci_main_uct at mail.uct.ac.za wrote:

>hi all
>
>why does R do this:
>
>(-8)^(1/3)=NaN
>
>the answer should be : -2

Allan

In my computer:
 > (-8)^(1/3)
[1] NaN

 > -8^(1/3)
[1] -2

 > -(8^(1/3))
[1] -2


The problem is -8 or the problem is (-8) ?


[]s
Tura 


-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.




More information about the R-help mailing list